java.lang.Object
org.opendaylight.yangtools.yang.data.tree.leafref.LeafRefPath
All Implemented Interfaces:
Immutable

public abstract class LeafRefPath extends Object implements Immutable
  • Field Details

    • 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 Details

  • Method Details

    • 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 node
      absolute - 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 relative
      path - 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 LeafRefPath
      newQname - 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.
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object