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.yangtools.yang.model.api.type;
10 import java.util.Objects;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.common.YangConstants;
17 * Contains methods for getting data from the <code>instance-identifier</code> YANG built-in type.
19 public interface InstanceIdentifierTypeDefinition
20 extends RequireInstanceRestrictedTypeDefinition<InstanceIdentifierTypeDefinition> {
22 * Well-known QName of the {@code instance-identifier} built-in type.
24 QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, "instance-identifier").intern();
26 static int hashCode(final @NonNull InstanceIdentifierTypeDefinition type) {
27 return Objects.hash(type.getQName(), type.getUnknownSchemaNodes(), type.getBaseType(),
28 type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.requireInstance());
31 static boolean equals(final @NonNull InstanceIdentifierTypeDefinition type, final @Nullable Object obj) {
36 final InstanceIdentifierTypeDefinition other = TypeDefinitions.castIfEquals(
37 InstanceIdentifierTypeDefinition.class, type, obj);
38 return other != null && type.requireInstance() == other.requireInstance();
41 static String toString(final @NonNull InstanceIdentifierTypeDefinition type) {
42 return TypeDefinitions.toStringHelper(type).add("requireInstance", type.requireInstance()).toString();