/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
package org.opendaylight.controller.model.util;\r
\r
import java.util.List;\r
\r
-import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;\r
import org.opendaylight.controller.model.api.type.RangeConstraint;\r
+import org.opendaylight.controller.model.api.type.UnsignedIntegerTypeDefinition;\r
import org.opendaylight.controller.yang.common.QName;\r
\r
-public class Uint16 extends AbstractInteger {\r
+/**\r
+ * Implementation of Yang uint32 built-in type. <br>\r
+ * uint16 represents integer values between 0 and 65535, inclusively. The Java\r
+ * counterpart of Yang uint32 built-in type is {@link Integer}.\r
+ * \r
+ */\r
+public class Uint16 extends AbstractUnsignedInteger {\r
\r
private static final QName name = BaseTypes.constructQName("uint16");\r
private Integer defaultValue = null;\r
- private static final String description = "";\r
- private static final String reference = "";\r
+ private static final String description = "uint16 represents integer values between 0 and 65535, inclusively.";\r
\r
public Uint16() {\r
- super(name, description, reference);\r
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
}\r
\r
public Uint16(final Integer defaultValue) {\r
- super(name, description, reference);\r
+ super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");\r
this.defaultValue = defaultValue;\r
}\r
\r
public Uint16(final List<RangeConstraint> rangeStatements,\r
- final Integer defaultValue) {\r
- super(name, description, reference, rangeStatements);\r
- this.defaultValue = defaultValue;\r
- }\r
-\r
- public Uint16(final String units, final Integer defaultValue) {\r
- super(name, description, reference, units);\r
+ final String units, final Integer defaultValue) {\r
+ super(name, description, rangeStatements, units);\r
this.defaultValue = defaultValue;\r
}\r
\r
/*\r
* (non-Javadoc)\r
* \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
+ * @see\r
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
*/\r
@Override\r
- public IntegerTypeDefinition getBaseType() {\r
+ public UnsignedIntegerTypeDefinition getBaseType() {\r
return this;\r
}\r
\r
/*\r
* (non-Javadoc)\r
* \r
- * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
+ * @see\r
+ * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue\r
+ * ()\r
*/\r
@Override\r
public Object getDefaultValue() {\r