Switch to Objects.requireNonNull
[mdsal.git] / binding / mdsal-binding-spec-util / src / main / java / org / opendaylight / mdsal / binding / spec / reflect / StringValueObjectFactory.java
index ac281ca986e2409dc4d6ef71446e4a78fb4ee967..06af2a195f2f62e23035d01bff10a3ae93520674 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.mdsal.binding.spec.reflect;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
@@ -48,9 +49,9 @@ public final class StringValueObjectFactory<T> {
     private final T template;
 
     private StringValueObjectFactory(final T template, final MethodHandle constructor, final MethodHandle setter) {
-        this.template = Preconditions.checkNotNull(template);
+        this.template = requireNonNull(template);
         this.constructor = constructor.bindTo(template);
-        this.setter = Preconditions.checkNotNull(setter);
+        this.setter = requireNonNull(setter);
     }
 
     public static <T> StringValueObjectFactory<T> create(final Class<T> clazz, final String templateString) {
@@ -137,7 +138,7 @@ public final class StringValueObjectFactory<T> {
 
     @SuppressWarnings("checkstyle:illegalCatch")
     public T newInstance(final String string) {
-        Preconditions.checkNotNull(string, "Argument may not be null");
+        requireNonNull(string, "Argument may not be null");
 
         try {
             final T ret = (T) constructor.invokeExact();