Class SchemaPath
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.api.SchemaPath
-
- All Implemented Interfaces:
Immutable
,MutationBehaviour<Immutable>
public abstract class SchemaPath extends Object implements Immutable
Represents unique path to the every node inside the module.
-
-
Field Summary
Fields Modifier and Type Field Description static @NonNull SchemaPath
ROOT
Shared instance of the conceptual root schema node.static @NonNull SchemaPath
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)
static @NonNull SchemaPath
create(boolean absolute, QName element)
Constructs new instance of this class with the concrete path.static @NonNull SchemaPath
create(boolean absolute, QName... path)
Constructs new instance of this class with the concrete path.static @NonNull SchemaPath
create(Iterable<QName> path, boolean absolute)
Constructs new instance of this class with the concrete path.@NonNull SchemaPath
createChild(Iterable<QName> relative)
Create a child path based on concatenation of this path and a relative path.abstract @NonNull SchemaPath
createChild(QName element)
Create a child path based on concatenation of this path and an additional path element.@NonNull SchemaPath
createChild(QName... elements)
Create a child path based on concatenation of this path and additional path elements.@NonNull SchemaPath
createChild(SchemaPath 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.SchemaPath
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 path is|isn't absolute.String
toString()
-
-
-
Field Detail
-
ROOT
public static final @NonNull SchemaPath ROOT
Shared instance of the conceptual root schema node.
-
SAME
public static final @NonNull SchemaPath SAME
Shared instance of the "same" relative schema node.
-
-
Method Detail
-
create
public static @NonNull SchemaPath 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 SchemaPath instance.
-
create
public static @NonNull SchemaPath create(boolean absolute, QName element)
Constructs new instance of this class with the concrete path.- Parameters:
absolute
- boolean value which specifies if the path is absolute or relativeelement
- a single QName which specifies exact path to the module node- Returns:
- A SchemaPath instance.
-
create
public static @NonNull SchemaPath 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 @NonNull SchemaPath 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 @NonNull SchemaPath createChild(SchemaPath 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 @NonNull SchemaPath createChild(QName element)
Create a child path based on concatenation of this path and an additional path element.- Parameters:
element
- Relative SchemaPath elements- Returns:
- A new child path
-
createChild
public @NonNull SchemaPath 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 SchemaPath 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.
-
isAbsolute
public abstract boolean isAbsolute()
Describes whether schema path is|isn't absolute.- Returns:
- boolean value which is
true
if schema path is absolute.
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
-
-