Class Sorting

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class Sorting
    extends java.lang.Object
    implements java.lang.Cloneable
    Specifies how a query is sorted by a list of fields with a sort order
    Author:
    Arne Bergene Fossaa
    • Constructor Detail

      • Sorting

        public Sorting()
        Creates an empty sort spec
      • Sorting

        public Sorting​(java.lang.String sortSpec)
        Creates a sort spec from a string
    • Method Detail

      • fromString

        public static Sorting fromString​(java.lang.String sortSpec)
        Creates a new sorting from the given string and returns it, or returns null if the argument does not contain any sorting criteria (e.g it is null or the empty string)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • fieldOrders

        public java.util.List<Sorting.FieldOrder> fieldOrders()
        Returns the field orders of this sort specification as list. This is never null but can be empty. This list can be modified to change this sort spec.
      • clone

        public Sorting clone()
        Overrides:
        clone in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • encode

        public int encode​(java.nio.ByteBuffer buffer)