2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.model.util;
\r
10 import java.math.BigInteger;
\r
11 import java.util.List;
\r
13 import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;
\r
14 import org.opendaylight.controller.model.api.type.RangeConstraint;
\r
15 import org.opendaylight.controller.yang.common.QName;
\r
17 public class Uint64 extends AbstractInteger {
\r
19 private static final QName name = BaseTypes.constructQName("uint32");
\r
20 private BigInteger defaultValue = null;
\r
21 private static final String description = "";
\r
22 private static final String reference = "";
\r
25 super(name, description, reference);
\r
28 public Uint64(final BigInteger defaultValue) {
\r
29 super(name, description, reference);
\r
30 this.defaultValue = defaultValue;
\r
33 public Uint64(final List<RangeConstraint> rangeStatements,
\r
34 final BigInteger defaultValue) {
\r
35 super(name, description, reference, rangeStatements);
\r
36 this.defaultValue = defaultValue;
\r
39 public Uint64(final String units, final BigInteger defaultValue) {
\r
40 super(name, description, reference, units);
\r
41 this.defaultValue = defaultValue;
\r
47 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
\r
50 public IntegerTypeDefinition getBaseType() {
\r
57 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
\r
60 public Object getDefaultValue() {
\r
61 return defaultValue;
\r
65 public int hashCode() {
\r
66 final int prime = 31;
\r
67 int result = super.hashCode();
\r
68 result = prime * result
\r
69 + ((defaultValue == null) ? 0 : defaultValue.hashCode());
\r
74 public boolean equals(Object obj) {
\r
78 if (!super.equals(obj)) {
\r
81 if (getClass() != obj.getClass()) {
\r
84 Uint64 other = (Uint64) obj;
\r
85 if (defaultValue == null) {
\r
86 if (other.defaultValue != null) {
\r
89 } else if (!defaultValue.equals(other.defaultValue)) {
\r
96 public String toString() {
\r
97 StringBuilder builder = new StringBuilder();
\r
98 builder.append("Uint64 [defaultValue=");
\r
99 builder.append(defaultValue);
\r
100 builder.append(", AbstractInteger=");
\r
101 builder.append(super.toString());
\r
102 builder.append("]");
\r
103 return builder.toString();
\r