Fix checkstyle issues reported by odlparent-3.0.0's checkstyle
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / nodes / AbstractImmutableNormalizedValueNode.java
index f5e9ba67ee65c79ac3a40a00d611a19e12df1ae6..2e6b6b1991378e35001fd286e038188b5d168087 100644 (file)
@@ -7,26 +7,33 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.nodes;
 
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import static java.util.Objects.requireNonNull;
 
-public abstract class AbstractImmutableNormalizedValueNode<K extends InstanceIdentifier.PathArgument, V> extends
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+
+public abstract class AbstractImmutableNormalizedValueNode<K extends PathArgument, V> extends
         AbstractImmutableNormalizedNode<K, V> {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractImmutableNormalizedValueNode.class);
+    @Nonnull
     private final V value;
 
-    protected AbstractImmutableNormalizedValueNode(final K nodeIdentifier, final V value) {
+    protected AbstractImmutableNormalizedValueNode(final K nodeIdentifier, @Nonnull final V value) {
         super(nodeIdentifier);
-        if (value == null) {
-            LOGGER.warn("The value of node " + nodeIdentifier.getNodeType() + " is null");
-        }
-        this.value = value;
+        this.value = requireNonNull(value);
     }
 
     @Override
     public final V getValue() {
+        return wrapValue(value);
+    }
+
+    @Nonnull
+    protected final V value() {
         return value;
     }
+
+    protected V wrapValue(final V valueToWrap) {
+        return valueToWrap;
+    }
 }