*/
package org.opendaylight.yangtools.yang.model.api.type;
+import java.util.Objects;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
/**
* @return boolean value which is true if the <code>require-instance</code> statement is true and vice versa
*/
boolean requireInstance();
+
+ static int hashCode(final InstanceIdentifierTypeDefinition type) {
+ return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(),
+ type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.requireInstance());
+ }
+
+ static boolean equals(final InstanceIdentifierTypeDefinition type, final Object obj) {
+ if (type == obj) {
+ return true;
+ }
+
+ final InstanceIdentifierTypeDefinition other = TypeDefinitions.castIfEquals(
+ InstanceIdentifierTypeDefinition.class, type, obj);
+ return other != null && type.requireInstance() == other.requireInstance();
+ }
+
+ static String toString(final InstanceIdentifierTypeDefinition type) {
+ return TypeDefinitions.toStringHelper(type).add("requireInstance", type.requireInstance()).toString();
+ }
}