2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10 import static com.google.common.base.Preconditions.checkArgument;
11 import com.google.common.base.Optional;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
16 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
17 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
19 final class UnorderedLeafSetModificationStrategy extends NormalizedNodeContainerModificationStrategy {
20 private final Optional<ModificationApplyOperation> entryStrategy;
22 @SuppressWarnings({ "unchecked", "rawtypes" })
23 UnorderedLeafSetModificationStrategy(final LeafListSchemaNode schema) {
24 super((Class) LeafSetNode.class);
25 entryStrategy = Optional.<ModificationApplyOperation> of(new LeafSetEntryModificationStrategy(schema));
28 @SuppressWarnings("rawtypes")
30 protected NormalizedNodeContainerBuilder createBuilder(final NormalizedNode<?, ?> original) {
31 checkArgument(original instanceof LeafSetNode<?>);
32 return ImmutableLeafSetNodeBuilder.create((LeafSetNode<?>) original);
36 public Optional<ModificationApplyOperation> getChild(final YangInstanceIdentifier.PathArgument identifier) {
37 if (identifier instanceof YangInstanceIdentifier.NodeWithValue) {
40 return Optional.absent();