Class Criterion

java.lang.Object
com.helixframework.pagination.cursor.Criterion
All Implemented Interfaces:
Serializable

public class Criterion extends Object implements Serializable
A criterion used for sorting or filtering data during pagination.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Criterion(String key, String value)
    A criterion used for sorting or filtering data during pagination.
    Criterion(String key, String value, com.helixframework.pagination.sort.SortOrder sortOrder)
    A criterion used for sorting or filtering data during pagination.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns the key of the criterion.
    com.helixframework.pagination.sort.SortOrder
    Returns the sort order of the criterion.
    Retrieves the value of the criterion.
    int
     
    static Criterion
    parse(String criterionStr)
    Parses a string representation of a criterion and creates a new Criterion object.
    void
    setSortOrder(com.helixframework.pagination.sort.SortOrder sortOrder)
    Sets the sort order of the criterion.
    void
    Sets the value of the criterion.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Criterion

      public Criterion(String key, String value)
      A criterion used for sorting or filtering data during pagination.
      Parameters:
      key - the key of the criterion
      value - the value of the criterion
    • Criterion

      public Criterion(String key, String value, com.helixframework.pagination.sort.SortOrder sortOrder)
      A criterion used for sorting or filtering data during pagination.
      Parameters:
      key - the key of the criterion
      value - the value of the criterion
      sortOrder - the sort order of the criterion
  • Method Details

    • parse

      public static Criterion parse(String criterionStr)
      Parses a string representation of a criterion and creates a new Criterion object.
      Parameters:
      criterionStr - the string representation of the criterion
      Returns:
      the parsed Criterion object
      Throws:
      IllegalArgumentException - if the criterionStr does not match the expected format
    • getKey

      public String getKey()
      Returns the key of the criterion.
      Returns:
      the key of the criterion
    • getValue

      public String getValue()
      Retrieves the value of the criterion.
      Returns:
      the value of the criterion
    • getSortOrder

      public com.helixframework.pagination.sort.SortOrder getSortOrder()
      Returns the sort order of the criterion.
      Returns:
      the sort order of the criterion
    • setValue

      public void setValue(String value)
      Sets the value of the criterion.
      Parameters:
      value - the new value of the criterion
    • setSortOrder

      public void setSortOrder(com.helixframework.pagination.sort.SortOrder sortOrder)
      Sets the sort order of the criterion.
      Parameters:
      sortOrder - the sort order to be set
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object