X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fyang%2Fyang-model-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang%2Fmodel%2Futil%2FUint64.java;h=e95a6232dbb0102e48db2a9e721c106bc87fe98a;hp=b5af55fc41150d11c6ddc97d62d877e56a08c42f;hb=e72ae0ab1513e382e141f70dc544efdd782e439d;hpb=4ce0f6630bc576b97c8c9a08848aafb6e90a75b0 diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Uint64.java b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Uint64.java index b5af55fc41..e95a6232db 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Uint64.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/Uint64.java @@ -8,10 +8,9 @@ package org.opendaylight.controller.yang.model.util; import java.math.BigInteger; -import java.util.List; import org.opendaylight.controller.yang.common.QName; -import org.opendaylight.controller.yang.model.api.type.RangeConstraint; +import org.opendaylight.controller.yang.model.api.SchemaPath; import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition; /** @@ -19,44 +18,34 @@ import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefini * uint64 represents integer values between 0 and 18446744073709551615, * inclusively. The Java counterpart of Yang uint64 built-in type is * {@link BigInteger}. - * + * */ -public class Uint64 extends AbstractUnsignedInteger { - +public final class Uint64 extends AbstractUnsignedInteger { + public static final BigInteger MAX_VALUE = new BigInteger("18446744073709551615"); private static final QName name = BaseTypes.constructQName("uint64"); - private BigInteger defaultValue = null; - private static final String description = - "uint64 represents integer values between 0 and 18446744073709551615, inclusively."; - - public Uint64() { - super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, ""); - } + private final BigInteger defaultValue = null; + private static final String description = "uint64 represents integer values between 0 and 18446744073709551615, inclusively."; + private final UnsignedIntegerTypeDefinition baseType; - public Uint64(final BigInteger defaultValue) { - super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, ""); - this.defaultValue = defaultValue; - } - - public Uint64(final List rangeStatements, - final String units, final BigInteger defaultValue) { - super(name, description, rangeStatements, units); - this.defaultValue = defaultValue; + public Uint64(final SchemaPath path) { + super(path, name, description, MAX_VALUE, ""); + this.baseType = this; } /* * (non-Javadoc) - * + * * @see * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType() */ @Override public UnsignedIntegerTypeDefinition getBaseType() { - return this; + return baseType; } /* * (non-Javadoc) - * + * * @see * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue * () @@ -70,8 +59,7 @@ public class Uint64 extends AbstractUnsignedInteger { public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result - + ((defaultValue == null) ? 0 : defaultValue.hashCode()); + result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode()); return result; } @@ -107,4 +95,5 @@ public class Uint64 extends AbstractUnsignedInteger { builder.append("]"); return builder.toString(); } + }