X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fyang%2Fyang-model-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang%2Fmodel%2Futil%2FDecimal64.java;h=1387da9b1cf5ead763a14d21b8b3d784ecc6ceb5;hb=970fb91c60c15a9b57e078f81aab7dde903addb9;hp=6a070837bd8e9f3f79cec5c02639ffbdd7f0965b;hpb=d04b927ef78082525c3b0738126b6eb12e4a7a74;p=controller.git diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Decimal64.java b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Decimal64.java index 6a070837bd..1387da9b1c 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Decimal64.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Decimal64.java @@ -26,11 +26,10 @@ import org.opendaylight.controller.yang.model.api.type.RangeConstraint; * @see DecimalTypeDefinition */ public final class Decimal64 implements DecimalTypeDefinition { - private final QName name = BaseTypes.constructQName("decimal64"); private final SchemaPath path; - private String units = ""; - private BigDecimal defaultValue = null; + private final String units = ""; + private final BigDecimal defaultValue = null; private final String description = "The decimal64 type represents a subset of the real numbers, which can " + "be represented by decimal numerals. The value space of decimal64 is the set of numbers that can " @@ -54,25 +53,14 @@ public final class Decimal64 implements DecimalTypeDefinition { * If the fraction digits are not defined inner the definition boundaries * the constructor will throw {@link IllegalArgumentException} * + * @param path * @param fractionDigits * integer between 1 and 18 inclusively * * @see DecimalTypeDefinition * @exception IllegalArgumentException */ - private Decimal64(final Integer fractionDigits) { - if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) { - throw new IllegalArgumentException( - "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively"); - } - this.fractionDigits = fractionDigits; - this.rangeStatements = defaultRangeStatements(); - this.path = BaseTypes.schemaPath(name); - this.baseType = this; - } - public Decimal64(final SchemaPath path, final Integer fractionDigits) { - super(); if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) { throw new IllegalArgumentException( "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively"); @@ -80,97 +68,7 @@ public final class Decimal64 implements DecimalTypeDefinition { this.fractionDigits = fractionDigits; rangeStatements = defaultRangeStatements(); this.path = path; - this.baseType = new Decimal64(fractionDigits); - } - - /** - * Decimal64 Type Constructor.
- * - * If parameter Range Statements is null or - * defined as empty List the constructor automatically assigns - * the boundaries as min and max value defined for Decimal64 in [RFC-6020] The - * decimal64 Built-In Type
- *
- * The fractions digits MUST be defined as integer between 1 and 18 - * inclusively as defined interface {@link DecimalTypeDefinition}
- * If the fraction digits are not defined inner the definition boundaries - * the constructor will throw {@link IllegalArgumentException} - * - * @param actualPath - * @param namespace - * @param revision - * @param rangeStatements - * Range Constraint Statements - * @param fractionDigits - * integer between 1 and 18 inclusively - * @exception IllegalArgumentException - */ - public Decimal64(final SchemaPath path, final List rangeStatements, - Integer fractionDigits) { - super(); - if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) { - throw new IllegalArgumentException( - "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively"); - } - if (rangeStatements == null || rangeStatements.isEmpty()) { - this.rangeStatements = defaultRangeStatements(); - } else { - this.rangeStatements = Collections - .unmodifiableList(rangeStatements); - } - this.fractionDigits = fractionDigits; - this.path = path; - this.baseType = new Decimal64(fractionDigits); - } - - /** - * Decimal64 Type Constructor.
- * If parameter Range Statements is null or - * defined as empty List the constructor automatically assigns - * the boundaries as min and max value defined for Decimal64 in [RFC-6020] The - * decimal64 Built-In Type
- *
- * The fractions digits MUST be defined as integer between 1 and 18 - * inclusively as defined interface {@link DecimalTypeDefinition}
- * If the fraction digits are not defined inner the definition boundaries - * the constructor will throw {@link IllegalArgumentException} - * - * @param actualPath - * @param namespace - * @param revision - * @param units - * units associated with the type - * @param defaultValue - * Default Value for type - * @param rangeStatements - * Range Constraint Statements - * @param fractionDigits - * integer between 1 and 18 inclusively - */ - public Decimal64(final SchemaPath path, final String units, - final BigDecimal defaultValue, - final List rangeStatements, - final Integer fractionDigits) { - super(); - if (!((fractionDigits.intValue() > 1) && (fractionDigits.intValue() <= 18))) { - throw new IllegalArgumentException( - "The fraction digits outside of boundaries. Fraction digits MUST be integer between 1 and 18 inclusively"); - } - - if (rangeStatements == null || rangeStatements.isEmpty()) { - this.rangeStatements = defaultRangeStatements(); - - } else { - this.rangeStatements = Collections - .unmodifiableList(rangeStatements); - } - this.units = units; - this.defaultValue = defaultValue; - this.fractionDigits = fractionDigits; - this.path = path; - this.baseType = new Decimal64(fractionDigits); + this.baseType = this; } /**