*/
public final class InstanceIdentifier implements InstanceIdentifierTypeDefinition {
private static final QName name = BaseTypes.constructQName("instance-identifier");
+ private static final SchemaPath path = new SchemaPath(Collections.singletonList(name), true);
private static final String description = "The instance-identifier built-in type is used to "
+ "uniquely identify a particular instance node in the data tree.";
private static final String reference = "https://tools.ietf.org/html/rfc6020#section-9.13";
- private final transient SchemaPath path;
private final RevisionAwareXPath xpath;
- private final String units = "";
- private final InstanceIdentifierTypeDefinition baseType;
+ private static final String units = "";
private boolean requireInstance = true;
- public InstanceIdentifier(final SchemaPath path, final RevisionAwareXPath xpath) {
- super();
- this.path = path;
+ public InstanceIdentifier(final RevisionAwareXPath xpath) {
this.xpath = xpath;
- this.baseType = this;
}
- public InstanceIdentifier(final SchemaPath path, final RevisionAwareXPath xpath, final boolean requireInstance) {
- super();
- this.path = path;
+ public InstanceIdentifier(final RevisionAwareXPath xpath, final boolean requireInstance) {
this.xpath = xpath;
this.requireInstance = requireInstance;
- this.baseType = this;
}
/*
*/
@Override
public InstanceIdentifierTypeDefinition getBaseType() {
- return baseType;
+ return this;
}
/*
return requireInstance;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (requireInstance ? 1231 : 1237);
+ result = prime * result + ((xpath == null) ? 0 : xpath.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ InstanceIdentifier other = (InstanceIdentifier) obj;
+ if (requireInstance != other.requireInstance)
+ return false;
+ if (xpath == null) {
+ if (other.xpath != null)
+ return false;
+ } else if (!xpath.equals(other.xpath))
+ return false;
+ return true;
+ }
+
}