Convert to using requireNonNull()
[netconf.git] / restconf / restconf-common / src / main / java / org / opendaylight / restconf / common / patch / PatchEntity.java
index 790892304c9c46bdc79dd2a66ad28f8432f9630f..a57698ce934c5245096e2e45fb3cb442e2ec6ec5 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.restconf.common.patch;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -28,10 +28,10 @@ public class PatchEntity {
      */
     public PatchEntity(final String editId, final PatchEditOperation operation, final YangInstanceIdentifier targetNode,
                        final NormalizedNode<?, ?> node) {
-        this.editId = Preconditions.checkNotNull(editId);
-        this.operation = Preconditions.checkNotNull(operation);
-        this.targetNode = Preconditions.checkNotNull(targetNode);
-        this.node = Preconditions.checkNotNull(node);
+        this.editId = requireNonNull(editId);
+        this.operation = requireNonNull(operation);
+        this.targetNode = requireNonNull(targetNode);
+        this.node = requireNonNull(node);
     }
 
     /**
@@ -43,9 +43,9 @@ public class PatchEntity {
      */
     public PatchEntity(final String editId, final PatchEditOperation operation,
             final YangInstanceIdentifier targetNode) {
-        this.editId = Preconditions.checkNotNull(editId);
-        this.operation = Preconditions.checkNotNull(operation);
-        this.targetNode = Preconditions.checkNotNull(targetNode);
+        this.editId = requireNonNull(editId);
+        this.operation = requireNonNull(operation);
+        this.targetNode = requireNonNull(targetNode);
         this.node = null;
     }