Interface Traversable<T>

  • Type Parameters:
    T - type of traversable resource
    All Known Subinterfaces:
    VeneeredPage, VeneeredResource
    All Known Implementing Classes:
    AbstractComponent

    public interface Traversable<T>
    Definition for hierarchical JCR resources that can be traversed.
    • Method Detail

      • findAncestor

        Optional<T> findAncestor​(Predicate<T> predicate)
        Find the first ancestor resource that matches the given predicate condition.
        Parameters:
        predicate - predicate to match ancestor resources against
        Returns:
        Optional resource that matches the predicate condition
      • findAncestor

        Optional<T> findAncestor​(Predicate<T> predicate,
                                 boolean excludeCurrentResource)
        Find the first ancestor resource that matches the given predicate condition.
        Parameters:
        predicate - predicate to match ancestor resources against
        excludeCurrentResource - if true, the current resource will be excluded (i.e. even if the current resource matches the predicate criteria, it will not be returned)
        Returns:
        Optional resource that matches the predicate condition
      • findAncestorWithProperty

        Optional<T> findAncestorWithProperty​(String propertyName)
        Find the first ancestor resource containing the given property name.
        Parameters:
        propertyName - property name to find on ancestor resources
        Returns:
        Optional resource that contains the property
      • findAncestorWithProperty

        Optional<T> findAncestorWithProperty​(String propertyName,
                                             boolean excludeCurrentResource)
        Find the first ancestor resource containing the given property name.
        Parameters:
        propertyName - property name to find on ancestor resources
        excludeCurrentResource - if true, the current resource will be excluded (i.e. even if the current resource matches the predicate criteria, it will not be returned)
        Returns:
        Optional resource that contains the property
      • findAncestorWithPropertyValue

        <V> Optional<T> findAncestorWithPropertyValue​(String propertyName,
                                                      V propertyValue)
        Find the first ancestor resource where the given property name has the specified value.
        Type Parameters:
        V - type of value
        Parameters:
        propertyName - property name to find on ancestor resources
        propertyValue - value of named property to match
        Returns:
        Optional resource that contains the property value
      • findAncestorWithPropertyValue

        <V> Optional<T> findAncestorWithPropertyValue​(String propertyName,
                                                      V propertyValue,
                                                      boolean excludeCurrentResource)
        Find the first ancestor resource where the given property name has the specified value.
        Type Parameters:
        V - type of value
        Parameters:
        propertyName - property name to find on ancestor resources
        propertyValue - value of named property to match
        excludeCurrentResource - if true, the current resource will be excluded (i.e. even if the current resource matches the predicate criteria, it will not be returned)
        Returns:
        Optional resource that contains the property value
      • findDescendants

        List<T> findDescendants​(Predicate<T> predicate)
        Get a list of descendant resources that match the given predicate condition.
        Parameters:
        predicate - predicate to match descendant resources against
        Returns:
        list of resources that match the predicate condition or empty list if none exist