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 int64 built-in type. <br>
16 * int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.
17 * The Java counterpart of Yang int64 built-in type is
21 public final class Int64 extends AbstractSignedInteger {
22 private static final QName name = BaseTypes.constructQName("int64");
23 private final Long defaultValue = null;
24 private static final String description =
25 "int64 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.";
26 private final IntegerTypeDefinition baseType;
28 public Int64(final SchemaPath path) {
29 super(path, name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
36 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()
39 public IntegerTypeDefinition getBaseType() {
46 * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()
49 public Object getDefaultValue() {
54 public int hashCode() {
56 int result = super.hashCode();
57 result = prime * result
58 + ((defaultValue == null) ? 0 : defaultValue.hashCode());
63 public boolean equals(Object obj) {
67 if (!super.equals(obj)) {
70 if (getClass() != obj.getClass()) {
73 Int64 other = (Int64) 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("Int64 [defaultValue=");
88 builder.append(defaultValue);
89 builder.append(", AbstractInteger=");
90 builder.append(super.toString());
92 return builder.toString();