Rework NormalizedNode type hierarchy
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableMapEntryNodeSchemaAwareBuilder.java
index 557b7a57cf8e52ea1c356ca856d3f1432dc51897..f5cb003f05947bfcc92f095e499ee4a7a0362e1c 100644 (file)
@@ -14,6 +14,7 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.Map.Entry;
 import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.util.ImmutableMapTemplate;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -42,7 +43,7 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE
 
     @Override
     public DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> withChild(
-            final DataContainerChild<?, ?> child) {
+            final DataContainerChild child) {
         validator.validateChild(child.getIdentifier());
         return super.withChild(child);
     }
@@ -78,7 +79,7 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE
         final Object[] values = new Object[childrenQNamesToPaths.size()];
         int offset = 0;
         for (Entry<QName, PathArgument> entry : childrenQNamesToPaths.entrySet()) {
-            values[offset++] = nonnullKeyValue(entry.getKey(), getChild(entry.getValue())).getValue();
+            values[offset++] = nonnullKeyValue(entry.getKey(), getChild(entry.getValue())).body();
         }
         return ImmutableMapTemplate.ordered(childrenQNamesToPaths.keySet()).instantiateWithValues(values);
     }
@@ -87,12 +88,12 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE
         final Object[] values = new Object[keys.size()];
         int offset = 0;
         for (QName key : keys) {
-            values[offset++] = nonnullKeyValue(key, getChild(childrenQNamesToPaths.get(key))).getValue();
+            values[offset++] = nonnullKeyValue(key, getChild(childrenQNamesToPaths.get(key))).body();
         }
         return ImmutableMapTemplate.ordered(keys).instantiateWithValues(values);
     }
 
-    private DataContainerChild<?, ?> nonnullKeyValue(final QName key, final DataContainerChild<?, ?> value) {
+    private DataContainerChild nonnullKeyValue(final QName key, final @Nullable DataContainerChild value) {
         if (value != null) {
             return value;
         }