Class OrderBy


  • public final class OrderBy
    extends Object
    Ordering clause for query results: a sort key and a direction.
    • Constructor Detail

      • OrderBy

        public OrderBy​(String key,
                       boolean ascending)
        Creates an ordering clause.
        Parameters:
        key - the attribute name to sort by
        ascending - whether results sort in ascending order
    • Method Detail

      • key

        public String key()
        Returns:
        the sort key attribute name
      • ascending

        public boolean ascending()
        Returns:
        whether results sort in ascending order
      • asc

        public static OrderBy asc​(String key)
        Creates an ascending ordering.
        Parameters:
        key - the attribute name to sort by
        Returns:
        the ascending clause
      • desc

        public static OrderBy desc​(String key)
        Creates a descending ordering.
        Parameters:
        key - the attribute name to sort by
        Returns:
        the descending clause
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object