Class SchemaNodeIdentifier
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier
-
- All Implemented Interfaces:
Immutable
,MutationBehaviour<Immutable>
- Direct Known Subclasses:
SchemaNodeIdentifier.Absolute
,SchemaNodeIdentifier.Relative
public abstract class SchemaNodeIdentifier extends Object implements Immutable
Represents unique path to the every schema node inside the schema node identifier namespace.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaNodeIdentifier.Absolute
An absolute schema node identifier.static class
SchemaNodeIdentifier.Relative
A relative schema node identifier.
-
Field Summary
Fields Modifier and Type Field Description static SchemaNodeIdentifier.Absolute
ROOT
Shared instance of the conceptual root schema node.static SchemaNodeIdentifier.Relative
SAME
Shared instance of the "same" relative schema node.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
SchemaPath
asSchemaPath()
Create theSchemaPath
equivalent of this identifier.static SchemaNodeIdentifier
create(boolean absolute, QName... path)
Constructs new instance of this class with the concrete path.static SchemaNodeIdentifier
create(Iterable<QName> path, boolean absolute)
Constructs new instance of this class with the concrete path.SchemaNodeIdentifier
createChild(Iterable<QName> relative)
Create a child path based on concatenation of this path and a relative path.abstract SchemaNodeIdentifier
createChild(QName element)
Create a child path based on concatenation of this path and an additional path element.SchemaNodeIdentifier
createChild(QName... elements)
Create a child path based on concatenation of this path and additional path elements.SchemaNodeIdentifier
createChild(SchemaNodeIdentifier relative)
Create a child path based on concatenation of this path and a relative path.boolean
equals(Object obj)
QName
getLastComponent()
Get the last component of this path.SchemaNodeIdentifier
getParent()
Returns the immediate parent SchemaPath.Iterable<QName>
getPathFromRoot()
Returns the list of nodes which need to be traversed to get from the starting point (root for absolute SchemaPaths) to the node represented by this object.Iterable<QName>
getPathTowardsRoot()
Returns the list of nodes which need to be traversed to get from this node to the starting point (root for absolute SchemaPaths).int
hashCode()
abstract boolean
isAbsolute()
Describes whether schema node identifier is|isn't absolute.String
toString()
-
-
-
Field Detail
-
ROOT
public static final SchemaNodeIdentifier.Absolute ROOT
Shared instance of the conceptual root schema node.
-
SAME
public static final SchemaNodeIdentifier.Relative SAME
Shared instance of the "same" relative schema node.
-
-
Method Detail
-
create
public static SchemaNodeIdentifier create(Iterable<QName> path, boolean absolute)
Constructs new instance of this class with the concrete path.- Parameters:
path
- list of QName instances which specifies exact path to the module nodeabsolute
- boolean value which specifies if the path is absolute or relative- Returns:
- A SchemaNodeIdentifier instance.
-
create
public static SchemaNodeIdentifier create(boolean absolute, QName... path)
Constructs new instance of this class with the concrete path.- Parameters:
absolute
- boolean value which specifies if the path is absolute or relativepath
- one or more QName instances which specifies exact path to the module node- Returns:
- A SchemaPath instance.
-
createChild
public SchemaNodeIdentifier createChild(Iterable<QName> relative)
Create a child path based on concatenation of this path and a relative path.- Parameters:
relative
- Relative path- Returns:
- A new child path
-
createChild
public SchemaNodeIdentifier createChild(SchemaNodeIdentifier relative)
Create a child path based on concatenation of this path and a relative path.- Parameters:
relative
- Relative SchemaPath- Returns:
- A new child path
-
createChild
public abstract SchemaNodeIdentifier createChild(QName element)
Create a child path based on concatenation of this path and an additional path element.- Parameters:
element
- Next SchemaPath element- Returns:
- A new child path
-
createChild
public SchemaNodeIdentifier createChild(QName... elements)
Create a child path based on concatenation of this path and additional path elements.- Parameters:
elements
- Relative SchemaPath elements- Returns:
- A new child path
-
getPathFromRoot
public Iterable<QName> getPathFromRoot()
Returns the list of nodes which need to be traversed to get from the starting point (root for absolute SchemaPaths) to the node represented by this object.- Returns:
- list of
qname
instances which represents path from the root to the schema node.
-
getPathTowardsRoot
public Iterable<QName> getPathTowardsRoot()
Returns the list of nodes which need to be traversed to get from this node to the starting point (root for absolute SchemaPaths).- Returns:
- list of
qname
instances which represents path from the schema node towards the root.
-
getParent
public SchemaNodeIdentifier getParent()
Returns the immediate parent SchemaPath.- Returns:
- Parent path, null if this SchemaPath is already toplevel.
-
getLastComponent
public final QName getLastComponent()
Get the last component of this path.- Returns:
- The last component of this path.
-
asSchemaPath
public final SchemaPath asSchemaPath()
Create theSchemaPath
equivalent of this identifier.- Returns:
- SchemaPath equivalent.
-
isAbsolute
public abstract boolean isAbsolute()
Describes whether schema node identifier is|isn't absolute.- Returns:
- boolean value which is
true
if schema path is absolute.
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
-
-