Class GraphPolicy


  • public abstract class GraphPolicy
    extends java.lang.Object
    A policy guides how to traverse the graph. This class' methods are expected to be fast and are not required to be thread-safe.
    Since:
    5.1.0
    • Constructor Detail

      • GraphPolicy

        public GraphPolicy()
    • Method Detail

      • getCleanInstance

        public abstract GraphPolicy getCleanInstance()
        Create a clone of this graph policy that has fresh state.
        Returns:
        an instance ready to begin a new graph traversal
      • registerPredicate

        public void registerPredicate​(GraphPolicyRulePredicate predicate)
        Use the given predicate in executing this graph policy.
        Parameters:
        predicate - a graph policy predicate
      • setCondition

        public abstract void setCondition​(java.lang.String name)
        Set a named condition,
        Parameters:
        name - the name of the condition
      • isCondition

        public abstract boolean isCondition​(java.lang.String name)
        Check if a condition has been set.
        Parameters:
        name - the name of the condition
        Returns:
        if the condition is set
      • allObjects

        public static java.util.Set<GraphPolicy.Details> allObjects​(java.util.Collection<java.util.Set<GraphPolicy.Details>> linkedFrom,
                                                                    GraphPolicy.Details rootObject,
                                                                    java.util.Collection<java.util.Set<GraphPolicy.Details>> linkedTo)
        Utility method to return all the objects for review as a single set of objects.
        Parameters:
        linkedFrom - details of the objects linking to the root object
        rootObject - details of the root objects
        linkedTo - details of the objects linked by the root object
        Returns:
        details of all the objects passed as arguments