Class SortBy

java.lang.Object
nz.org.riskscape.engine.sort.SortBy

public class SortBy extends Object

Defines an sort by, consisting of an Expression to obtain a comparable value and SortBy.Direction.

  • Field Details

    • NONE

      public static final SortBy NONE
  • Constructor Details

  • Method Details

    • concatenate

      public static SortBy concatenate(SortBy... clauses)

      Convenience version of concatenate(List)

    • concatenate

      public static SortBy concatenate(List<SortBy> clauses)

      Concatenate a list of SortBys, return a new SortBy where the (n+1)th element is subordinate to the nth.

    • validate

      public List<Problem> validate(Struct tupleType, ExpressionRealizer expressionRealizer)

      Validate that tupleType would be able to be sorted by this SortBy.

      Parameters:
      tupleType -
      expressionRealizer - to realize expressions with
      Returns:
      problems encountered, if any
    • andThen

      public SortBy andThen(SortBy asNext)

      Builds a new SortBy clause where asNext is appended to the end of this SortBy chain.

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getExpr

      public Expression getExpr()

      Expression to extract value to sort by.

    • getDirection

      public SortBy.Direction getDirection()

      The direction in which to sort.

    • getNext

      public SortBy getNext()

      A subordinate, sort order