*/
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 {
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";