Class LeafRefPath
- java.lang.Object
-
- org.opendaylight.yangtools.yang.data.impl.leafref.LeafRefPath
-
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Immutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Immutable>
public abstract class LeafRefPath extends Object implements org.opendaylight.yangtools.concepts.Immutable
-
-
Field Summary
Fields Modifier and Type Field Description static LeafRefPath
ROOT
Shared instance of the conceptual root schema node.static LeafRefPath
SAME
Shared instance of the "same" relative schema node.
-
Constructor Summary
Constructors Modifier Constructor Description protected
LeafRefPath(LeafRefPath parent, QNameWithPredicate qname)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static LeafRefPath
create(boolean absolute, QNameWithPredicate... path)
Constructs new instance of this class with the concrete path.static LeafRefPath
create(Iterable<QNameWithPredicate> path, boolean absolute)
Constructs new instance of this class with the concrete path.LeafRefPath
createChild(Iterable<QNameWithPredicate> relative)
Create a child path based on concatenation of this path and a relative path.LeafRefPath
createChild(LeafRefPath relative)
Create a child path based on concatenation of this path and a relative path.LeafRefPath
createChild(QNameWithPredicate... elements)
Create a child path based on concatenation of this path and additional path elements.protected abstract LeafRefPath
createInstance(LeafRefPath newParent, QNameWithPredicate newQname)
Create a new instance.boolean
equals(Object obj)
QNameWithPredicate
getLastComponent()
Get the last component of this path.LeafRefPath
getParent()
Returns the immediate parent LeafRefPath.Iterable<QNameWithPredicate>
getPathFromRoot()
Returns the list of nodes which need to be traversed to get from the starting point (root for absolute LeafRefPaths) to the node represented by this object.Iterable<QNameWithPredicate>
getPathTowardsRoot()
Returns the list of nodes which need to be traversed to get from this node to the starting point (root for absolute LeafRefPaths).int
hashCode()
abstract boolean
isAbsolute()
Describes whether schema path is|isn't absolute.String
toString()
-
-
-
Field Detail
-
ROOT
public static final LeafRefPath ROOT
Shared instance of the conceptual root schema node.
-
SAME
public static final LeafRefPath SAME
Shared instance of the "same" relative schema node.
-
-
Constructor Detail
-
LeafRefPath
protected LeafRefPath(LeafRefPath parent, QNameWithPredicate qname)
-
-
Method Detail
-
create
public static LeafRefPath create(Iterable<QNameWithPredicate> path, boolean absolute)
Constructs new instance of this class with the concrete path.- Parameters:
path
- list of QNameWithPredicate instances which specifies exact path to the module nodeabsolute
- boolean value which specifies if the path is absolute or relative- Returns:
- A LeafRefPath instance.
-
create
public static LeafRefPath create(boolean absolute, QNameWithPredicate... 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 QNameWithPredicate instances which specifies exact path to the module node- Returns:
- A LeafRefPath instance.
-
createInstance
protected abstract LeafRefPath createInstance(LeafRefPath newParent, QNameWithPredicate newQname)
Create a new instance.- Parameters:
newParent
- Parent LeafRefPathnewQname
- next path element- Returns:
- A new LeafRefPath instance
-
createChild
public LeafRefPath createChild(Iterable<QNameWithPredicate> 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 LeafRefPath createChild(LeafRefPath relative)
Create a child path based on concatenation of this path and a relative path.- Parameters:
relative
- Relative LeafRefPath- Returns:
- A new child path
-
createChild
public LeafRefPath createChild(QNameWithPredicate... elements)
Create a child path based on concatenation of this path and additional path elements.- Parameters:
elements
- Relative LeafRefPath elements- Returns:
- A new child path
-
getPathFromRoot
public Iterable<QNameWithPredicate> getPathFromRoot()
Returns the list of nodes which need to be traversed to get from the starting point (root for absolute LeafRefPaths) 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<QNameWithPredicate> getPathTowardsRoot()
Returns the list of nodes which need to be traversed to get from this node to the starting point (root for absolute LeafRefPaths).- Returns:
- list of
qname
instances which represents path from the schema node towards the root.
-
getParent
public LeafRefPath getParent()
Returns the immediate parent LeafRefPath.- Returns:
- Parent path, null if this LeafRefPath is already toplevel.
-
getLastComponent
public final QNameWithPredicate 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.
-
-