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;
15 * Contains methods for getting data from the <code>instance-identifier</code> YANG built-in type.
17 public interface InstanceIdentifierTypeDefinition
18 extends RequireInstanceRestrictedTypeDefinition<InstanceIdentifierTypeDefinition> {
19 static int hashCode(final @NonNull InstanceIdentifierTypeDefinition type) {
20 return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(),
21 type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.requireInstance());
24 static boolean equals(final @NonNull InstanceIdentifierTypeDefinition type, final @Nullable Object obj) {
29 final InstanceIdentifierTypeDefinition other = TypeDefinitions.castIfEquals(
30 InstanceIdentifierTypeDefinition.class, type, obj);
31 return other != null && type.requireInstance() == other.requireInstance();
34 static String toString(final @NonNull InstanceIdentifierTypeDefinition type) {
35 return TypeDefinitions.toStringHelper(type).add("requireInstance", type.requireInstance()).toString();