import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.IdentityEffectiveStatementImpl;
final class LeafNodeCodecContext<D extends DataObject> extends NodeCodecContext<D> implements NodeContextSupplier {
return codec.deserialize(defaultValue);
}
+ if (defaultValue instanceof ImmutableList) {
+ return codec.deserialize(ImmutableSet.copyOf((ImmutableList) defaultValue));
+ }
+
if (defaultValue instanceof List) {
return codec.deserialize(defaultValue);
}
final Map.Entry<InstanceIdentifier<?>, DataObject> entry = registry.fromNormalizedNode(BI_TOP_LEVEL_LIST_FOO_PATH, foo);
final List<NestedList> nestedLists = new ArrayList<>();
- nestedLists.add(new NestedListBuilder().setKey(new NestedListKey("foo")).setType("").build());
- nestedLists.add(new NestedListBuilder().setKey(new NestedListKey("bar")).setType("").build());
+ nestedLists.add(new NestedListBuilder().setKey(new NestedListKey("foo")).build());
+ nestedLists.add(new NestedListBuilder().setKey(new NestedListKey("bar")).build());
final TopLevelList topLevelList = new TopLevelListBuilder().setKey(TOP_LEVEL_LIST_FOO_KEY).setNestedList(nestedLists).build();
assertEquals(topLevelList, entry.getValue());
}