com.citytechinc.aem.bedrock.api
Interface Traversable<T>

Type Parameters:
T - type of traversable resource
All Known Subinterfaces:
ComponentNode, PageDecorator

public interface Traversable<T>

Definition for hierarchical JCR resources that can be traversed.


Method Summary
 Optional<T> findAncestor(Predicate<T> predicate)
          Find the first ancestor resource that matches the given predicate condition.
 Optional<T> findAncestorWithProperty(String propertyName)
          Find the first ancestor resource containing the given property name.
<V> Optional<T>
findAncestorWithPropertyValue(String propertyName, V propertyValue)
          Find the first ancestor resource where the given property name has the specified value.
 List<T> findDescendants(Predicate<T> predicate)
          Get a list of descendant resources that match the given predicate condition.
 

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

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

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

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


Copyright © 2015 CITYTECH, Inc.. All rights reserved.