Cleanup use of Guava library
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / RangeConstraintEffectiveImpl.java
index 25a1a1e240a16b5ad8e9de0d8c0e177e54eb366e..6c599531722ddca8adc056572a6d259114975b0f 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Objects;
+import java.util.Optional;
 import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
 
 public class RangeConstraintEffectiveImpl implements RangeConstraint {
@@ -26,14 +27,14 @@ public class RangeConstraintEffectiveImpl implements RangeConstraint {
 
     public RangeConstraintEffectiveImpl(final Number min, final Number max, final Optional<String> description,
             final Optional<String> reference) {
-        this(min, max, description.orNull(), reference.orNull(), "range-out-of-specified-bounds",
+        this(min, max, description.orElse(null), reference.orElse(null), "range-out-of-specified-bounds",
                 "The argument is out of bounds <" + min + ", " + max + ">");
     }
 
     public RangeConstraintEffectiveImpl(final Number min, final Number max, final String description,
             final String reference, final String errorAppTag, final String errorMessage) {
-        this.min = Preconditions.checkNotNull(min, "min must not be null.");
-        this.max = Preconditions.checkNotNull(max, "max must not be null.");
+        this.min = requireNonNull(min, "min must not be null");
+        this.max = requireNonNull(max, "max must not be null");
         this.description = description;
         this.reference = reference;
         this.errorAppTag = errorAppTag != null ? errorAppTag : "range-out-of-specified-bounds";