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.util.List;
\r
12 import org.opendaylight.controller.model.api.type.IntegerTypeDefinition;
\r
13 import org.opendaylight.controller.model.api.type.RangeConstraint;
\r
14 import org.opendaylight.controller.yang.common.QName;
\r
16 public class Uint32 extends AbstractInteger {
\r
18 private static final QName name = BaseTypes.constructQName("uint32");
\r
19 private Long defaultValue = null;
\r
20 private static final String description = "";
\r
21 private static final String reference = "";
\r
24 super(name, description, reference);
\r
27 public Uint32(final Long defaultValue) {
\r
28 super(name, description, reference);
\r
29 this.defaultValue = defaultValue;
\r
32 public Uint32(final List<RangeConstraint> rangeStatements,
\r
33 final Long defaultValue) {
\r
34 super(name, description, reference, rangeStatements);
\r
35 this.defaultValue = defaultValue;
\r
38 public Uint32(final String units, final Long defaultValue) {
\r
39 super(name, description, reference, units);
\r
40 this.defaultValue = defaultValue;
\r
46 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
\r
49 public IntegerTypeDefinition getBaseType() {
\r
56 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
\r
59 public Object getDefaultValue() {
\r
60 return defaultValue;
\r
64 public int hashCode() {
\r
65 final int prime = 31;
\r
66 int result = super.hashCode();
\r
67 result = prime * result
\r
68 + ((defaultValue == null) ? 0 : defaultValue.hashCode());
\r
73 public boolean equals(Object obj) {
\r
77 if (!super.equals(obj)) {
\r
80 if (getClass() != obj.getClass()) {
\r
83 Uint32 other = (Uint32) obj;
\r
84 if (defaultValue == null) {
\r
85 if (other.defaultValue != null) {
\r
88 } else if (!defaultValue.equals(other.defaultValue)) {
\r
95 public String toString() {
\r
96 StringBuilder builder = new StringBuilder();
\r
97 builder.append("Uint32 [defaultValue=");
\r
98 builder.append(defaultValue);
\r
99 builder.append(", AbstractInteger=");
\r
100 builder.append(super.toString());
\r
101 builder.append("]");
\r
102 return builder.toString();
\r