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 public static final BigInteger MAX_VALUE = new BigInteger("18446744073709551615");
25 private static final QName name = BaseTypes.constructQName("uint64");
26 private final BigInteger defaultValue = null;
27 private static final String description = "uint64 represents integer values between 0 and 18446744073709551615, inclusively.";
28 private final UnsignedIntegerTypeDefinition baseType;
30 public Uint64(final SchemaPath path) {
31 super(path, name, description, MAX_VALUE, "");
39 * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
42 public UnsignedIntegerTypeDefinition getBaseType() {
50 * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
54 public Object getDefaultValue() {
59 public int hashCode() {
61 int result = super.hashCode();
62 result = prime * result + ((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();