Class SearchSort

java.lang.Object
com.atlassian.query.order.SearchSort
All Implemented Interfaces:
Serializable

public class SearchSort extends Object implements Serializable
A simple data bean representing a portion of the sort order (related to a clause) for a search query.

Together via the OrderBy these will determine the sorting order of the results returned by a Query.

Since:
4.0
See Also:
  • Constructor Details

    • SearchSort

      public SearchSort(String field)
    • SearchSort

      public SearchSort(String field, SortOrder order)
      Used to construct a search sort for a field with a direction.
      Parameters:
      field - to sort by.
      order - direction to sort by, if null the default order for the field will be used.
    • SearchSort

      public SearchSort(String field, io.atlassian.fugue.Option<Property> property, SortOrder order)
      Used to construct a search sort for a field with a direction and optional property
      Parameters:
      field - to sort by.
      property - property associated with sort filed this should be taken into consideration when constructing sort field
      order - direction to sort by, if null the default order for the field will be used.
    • SearchSort

      public SearchSort(String order, String field)
      Deprecated.
      Used to construct a search sort for a field with a direction.

      NOTE: it would be better if the order of these parameters was reversed but we are leaving it for backward compatibility.

      Parameters:
      order - the order of the sort, if null, will be the default order for the system, if not one of SortOrder.ASC or SortOrder.DESC it will default to SortOrder.ASC.
      field - to sort by.
    • SearchSort

      public SearchSort(SearchSort copy)
  • Method Details

    • getOrder

      public String getOrder()
    • getSortOrder

      public SortOrder getSortOrder()
    • getField

      public String getField()
    • getProperty

      public io.atlassian.fugue.Option<Property> getProperty()
    • isReverse

      public boolean isReverse()
    • 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