Package org.dizitart.no2.common
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SortableFields()Instantiates a newSortableFields.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortableFieldsaddField(String field, SortOrder sortOrder)Adds a field and its corresponding sort order to a list of sortable fields.List<Pair<String,SortOrder>>getSortingOrders()Gets the sort by field specifications.static SortableFieldswithNames(String... fields)Creates aSortableFieldsinstance with field names.-
Methods inherited from class org.dizitart.no2.common.Fields
addField, compareTo, equals, getEncodedName, getFieldNames, hashCode, startsWith, toString
-
-
-
-
Constructor Detail
-
SortableFields
public SortableFields()
Instantiates a newSortableFields.
-
-
Method Detail
-
withNames
public static SortableFields withNames(String... fields)
Creates aSortableFieldsinstance 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 fieldsortOrder- the sort order- Returns:
- the sortable fields
-
-