2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.yang.model.util;
10 import java.math.BigInteger;
12 import org.opendaylight.controller.yang.common.QName;
13 import org.opendaylight.controller.yang.model.api.SchemaPath;
14 import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
17 * Implementation of Yang uint64 built-in type. <br>
18 * uint64 represents integer values between 0 and 18446744073709551615,
19 * inclusively. The Java counterpart of Yang uint64 built-in type is
23 public final class Uint64 extends AbstractUnsignedInteger {
24 private static final QName name = BaseTypes.constructQName("uint64");
25 private final BigInteger defaultValue = null;
26 private static final String description = "uint64 represents integer values between 0 and 18446744073709551615, inclusively.";
27 private final UnsignedIntegerTypeDefinition baseType;
29 public Uint64(final SchemaPath path) {
30 super(path, name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
38 * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
41 public UnsignedIntegerTypeDefinition getBaseType() {
49 * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
53 public Object getDefaultValue() {
58 public int hashCode() {
60 int result = super.hashCode();
61 result = prime * result
62 + ((defaultValue == null) ? 0 : defaultValue.hashCode());
67 public boolean equals(Object obj) {
71 if (!super.equals(obj)) {
74 if (getClass() != obj.getClass()) {
77 Uint64 other = (Uint64) obj;
78 if (defaultValue == null) {
79 if (other.defaultValue != null) {
82 } else if (!defaultValue.equals(other.defaultValue)) {
89 public String toString() {
90 StringBuilder builder = new StringBuilder();
91 builder.append("Uint64 [defaultValue=");
92 builder.append(defaultValue);
93 builder.append(", AbstractInteger=");
94 builder.append(super.toString());
96 return builder.toString();