Interface ListFunction

  • All Known Implementing Classes:
    CombineStep, ConjoinStep, DifferenceStep, DisjunctStep, IntersectStep, MergeStep, ProductStep

    public interface ListFunction
    List functions are a separate paradigm for Steps as they behave in a Scope.Local manner by default. This class provides helper methods that are common amongst these steps and should be used to keep behavior consistent in terms of handling of incoming traversers and argument types.
    • Method Detail

      • asCollection

        static Collection asCollection​(Object iterable)
        Turn an iterable type into a collection. Doesn't wrap any non-iterable type into an iterable (e.g. single Object into list), but will transform one iterable type to another (e.g. array to list).
        Parameters:
        iterable - an Iterable or array.
        Returns:
        The iterable type as a Collection or null if argument isn't iterable.
      • asSet

        static Set asSet​(Object iterable)
        Turn an iterable type into a set. Doesn't wrap any non-iterable type into an iterable (e.g. single Object into set), but will transform one iterable type to another (e.g. array to set).
        Parameters:
        iterable - an Iterable or array.
        Returns:
        The iterable type as a Collection or null if argument isn't iterable.
      • getStepName

        String getStepName()
        Template method used for retrieving the implementing Step's name.
        Returns:
        this step's name.
      • convertArgumentToCollection

        default Collection convertArgumentToCollection​(Object arg)
      • convertArgumentToSet

        default Set convertArgumentToSet​(Object arg)
      • convertTraverserToSet

        default <S> Set convertTraverserToSet​(Traverser.Admin<S> traverser)