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 org.opendaylight.controller.yang.common.QName;
11 import org.opendaylight.controller.yang.model.api.SchemaPath;
12 import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
15 * Implementation of Yang uint32 built-in type. <br>
16 * uint32 represents integer values between 0 and 4294967295, inclusively.
19 public final class Uint32 extends AbstractUnsignedInteger {
20 public static final long MAX_VALUE = 4294967295L;
21 private static final QName name = BaseTypes.constructQName("uint32");
22 private final Long defaultValue = null;
23 private static final String description = "uint32 represents integer values between 0 and 4294967295, inclusively.";
24 private final UnsignedIntegerTypeDefinition baseType;
26 public Uint32(final SchemaPath path) {
27 super(path, name, description, MAX_VALUE, "");
35 * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
38 public UnsignedIntegerTypeDefinition getBaseType() {
46 * org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue
50 public Object getDefaultValue() {
55 public int hashCode() {
57 int result = super.hashCode();
58 result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
63 public boolean equals(Object obj) {
67 if (!super.equals(obj)) {
70 if (getClass() != obj.getClass()) {
73 Uint32 other = (Uint32) obj;
74 if (defaultValue == null) {
75 if (other.defaultValue != null) {
78 } else if (!defaultValue.equals(other.defaultValue)) {
85 public String toString() {
86 StringBuilder builder = new StringBuilder();
87 builder.append("Uint32 [defaultValue=");
88 builder.append(defaultValue);
89 builder.append(", AbstractInteger=");
90 builder.append(super.toString());
92 return builder.toString();