X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Futil%2FBaseConstraints.java;h=e5f84310c4d0a6c4b501bf8e9e34843125093ff1;hb=0ce2b2fa5a3240324890b6092f3f882ea5f23ba1;hp=3116132b0220a71a3cef823a7c2bc1dbe94e53bb;hpb=fc9c81c01de81734a2a96434af938be0df754ba1;p=yangtools.git diff --git a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseConstraints.java b/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseConstraints.java index 3116132b02..e5f84310c4 100644 --- a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseConstraints.java +++ b/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseConstraints.java @@ -7,11 +7,9 @@ */ package org.opendaylight.yangtools.yang.model.util; -import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint; +import java.util.Optional; import org.opendaylight.yangtools.yang.model.api.type.ModifierKind; import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint; -import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint; /** * Utility class which provides factory methods to construct Constraints. @@ -19,122 +17,12 @@ import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint; *

* Provides static factory methods which constructs instances of *

*/ public final class BaseConstraints { private BaseConstraints() { - throw new UnsupportedOperationException(); - } - - /** - * Creates a {@link LengthConstraint}. - * - *

- * Creates an instance of Length constraint based on supplied parameters - * with additional behaviour: - *

- * - * @see LengthConstraint - * - * @param min length-restricting lower bound value. The value MUST NOT be negative. - * @param max length-restricting upper bound value. The value MUST NOT be negative. - * @param description Description associated with constraint. {@link Optional#absent()} if description is undefined. - * @param reference Reference associated with constraint. {@link Optional#absent()} if reference is undefined. - * @return Instance of {@link LengthConstraint} - */ - public static LengthConstraint newLengthConstraint(final Number min, final Number max, - final Optional description, final Optional reference) { - return new LengthConstraintImpl(min, max, description, reference); - } - - /** - * Creates a {@link LengthConstraint}. - * - *

- * Creates an instance of Length constraint based on supplied parameters - * with additional behaviour: - *

- * - * @see LengthConstraint - * - * @param min length-restricting lower bound value. The value MUST NOT be negative. - * @param max length-restricting upper bound value. The value MUST NOT be negative. - * @param description Description associated with constraint. {@link Optional#absent()} if description is undefined. - * @param reference Reference associated with constraint. {@link Optional#absent()} if reference is undefined. - * @param errorAppTag error-app-tag associated with constraint. - * @param errorMessage error message associated with constraint. - * @return Instance of {@link LengthConstraint} - */ - public static LengthConstraint newLengthConstraint(final Number min, final Number max, - final Optional description, final Optional reference, final String errorAppTag, - final String errorMessage) { - return new LengthConstraintImpl(min, max, description, reference, errorAppTag, errorMessage); - } - - /** - * Creates a {@link RangeConstraint}. - * - *

- * Creates an instance of Range constraint based on supplied parameters - * with additional behaviour: - *

    - *
  • {@link RangeConstraint#getErrorAppTag()} returns range-out-of-specified-bounds - *
  • {@link RangeConstraint#getErrorMessage()} returns The argument is out of bounds - * <min, max > - *
- * - * @see RangeConstraint - * - * @param Type of constraint - * @param min value-restricting lower bound value. The value MUST NOT Be null. - * @param max value-restricting upper bound value. The value MUST NOT Be null. - * @param description Description associated with constraint. {@link Optional#absent()} if description is undefined. - * @param reference Reference associated with constraint. {@link Optional#absent()} if reference is undefined. - * @return Instance of {@link RangeConstraint} - */ - public static RangeConstraint newRangeConstraint(final T min, final T max, - final Optional description, final Optional reference) { - return new RangeConstraintImpl(min, max, description, reference); - } - - /** - * Creates a {@link RangeConstraint}. - * - *

- * Creates an instance of Range constraint based on supplied parameters - * with additional behaviour: - *

    - *
  • {@link RangeConstraint#getErrorAppTag()} returns range-out-of-specified-bounds - *
  • {@link RangeConstraint#getErrorMessage()} returns The argument is out of bounds - * <min, max > - *
- * - * @see RangeConstraint - * - * @param Type of constraint - * @param min value-restricting lower bound value. The value MUST NOT Be null. - * @param max value-restricting upper bound value. The value MUST NOT Be null. - * @param description Description associated with constraint. {@link Optional#absent()} if description is undefined. - * @param reference Reference associated with constraint. {@link Optional#absent()} if reference is undefined. - * @param errorAppTag error-app-tag associated with constraint. - * @param errorMessage error message associated with constraint. - * @return Instance of {@link RangeConstraint} - */ - public static RangeConstraint newRangeConstraint(final T min, final T max, - final Optional description, final Optional reference, final String errorAppTag, - final String errorMessage) { - return new RangeConstraintImpl(min, max, description, reference, errorAppTag, errorMessage); + // Hidden on purpose } /**