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.IntegerTypeDefinition;
15 * Implementation of Yang int32 built-in type. <br>
16 * int32 represents integer values between -2147483648 and 2147483647,
17 * inclusively. The Java counterpart of Yang int32 built-in type is
20 * @see AbstractSignedInteger
23 public final class Int32 extends AbstractSignedInteger {
24 private static final QName name = BaseTypes.constructQName("int32");
25 private final Integer defaultValue = null;
26 private static final String description = "int32 represents integer values between -2147483648 and 2147483647, inclusively.";
27 private final IntegerTypeDefinition baseType;
29 public Int32(final SchemaPath path) {
30 super(path, name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
38 * org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
41 public IntegerTypeDefinition 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 Int32 other = (Int32) 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("Int32 [defaultValue=");
92 builder.append(defaultValue);
93 builder.append(", AbstractInteger=");
94 builder.append(super.toString());
96 return builder.toString();