Class SortableFields

java.lang.Object
org.dizitart.no2.common.Fields
org.dizitart.no2.common.SortableFields
All Implemented Interfaces:
Serializable, Comparable<Fields>

public class SortableFields extends Fields
Represents a collection of fields that can be sorted, with each field having a specified sort order.
Since:
4.0
Author:
Anindya Chatterjee
See Also:
  • Constructor Details

    • SortableFields

      public SortableFields()
      Instantiates a new SortableFields.
  • Method Details

    • withNames

      public static SortableFields withNames(String... fields)
      Creates a SortableFields instance with field names.
      Parameters:
      fields - the fields
      Returns:
      the fields
    • addField

      public SortableFields addField(String field, SortOrder sortOrder)
      Adds a field and its corresponding sort order to a list of sortable fields.
      Parameters:
      field - the field
      sortOrder - the sort order
      Returns:
      the sortable fields
    • getSortingOrders

      public List<Pair<String,SortOrder>> getSortingOrders()
      Gets the sort by field specifications.
      Returns:
      the sort specs