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 / builder / impl / ImmutableOrderedLeafSetNodeSchemaAwareBuilder.java
index d016754eccb04ffc06c2bd004f34d3c68eb19703..48b9d8fa191502bebce902902b2a0793eeb1619d 100644 (file)
@@ -7,8 +7,10 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
 
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Sets;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
+import java.util.Collections;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
@@ -21,14 +23,14 @@ public final class ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T> extends Immu
     private final LeafListSchemaNode schema;
 
     private ImmutableOrderedLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema) {
-        this.schema = Preconditions.checkNotNull(schema);
+        this.schema = requireNonNull(schema);
         super.withNodeIdentifier(new NodeIdentifier(schema.getQName()));
     }
 
     public ImmutableOrderedLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema,
             final ImmutableOrderedLeafSetNode<T> node) {
         super(node);
-        this.schema = Preconditions.checkNotNull(schema);
+        this.schema = requireNonNull(schema);
         // FIXME: Preconditions.checkArgument(schema.getQName().equals(node.getIdentifier()));
         super.withNodeIdentifier(new NodeIdentifier(schema.getQName()));
     }
@@ -47,23 +49,23 @@ public final class ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T> extends Immu
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue) {
         // TODO check value type
-        return super.withChildValue(value);
+        return super.withChildValue(childValue);
     }
 
     @Override
     public ListNodeBuilder<T, LeafSetEntryNode<T>> withChild(final LeafSetEntryNode<T> child) {
-        Preconditions.checkArgument(schema.getQName().equals(child.getNodeType()),
-                "Incompatible node type, should be: %s, is: %s", schema.getQName(), child.getNodeType());
+        checkArgument(schema.getQName().equals(child.getNodeType()), "Incompatible node type, should be: %s, is: %s",
+            schema.getQName(), child.getNodeType());
         // TODO check value type using TypeProvider ?
         DataValidationException.checkLegalChild(schema.getQName().equals(child.getNodeType()), child.getIdentifier(),
-            schema, Sets.newHashSet(schema.getQName()));
+            schema, Collections.singleton(schema.getQName()));
         return super.withChild(child);
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }