18caa978427c4c8dd75206eb0fa39c3775239bef
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / type / BaseInstanceIdentifierType.java
1 /*
2  * Copyright (c) 2015 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.util.type;
9
10 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
11 import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
12 import org.opendaylight.yangtools.yang.model.util.BaseTypes;
13
14 final class BaseInstanceIdentifierType extends AbstractBaseType<InstanceIdentifierTypeDefinition>
15         implements InstanceIdentifierTypeDefinition {
16     static final BaseInstanceIdentifierType INSTANCE = new BaseInstanceIdentifierType();
17
18     private BaseInstanceIdentifierType() {
19         super(BaseTypes.INSTANCE_IDENTIFIER_QNAME);
20     }
21
22     @Deprecated
23     @Override
24     public RevisionAwareXPath getPathStatement() {
25         throw new UnsupportedOperationException("API design error");
26     }
27
28     @Override
29     public boolean requireInstance() {
30         return false;
31     }
32
33     @Override
34     public int hashCode() {
35         return TypeDefinitions.hashCode(this);
36     }
37
38     @Override
39     public boolean equals(final Object obj) {
40         return TypeDefinitions.equals(this, obj);
41     }
42
43     @Override
44     public String toString() {
45         return TypeDefinitions.toString(this);
46     }
47 }