Class SortInfo

java.lang.Object
com.appiancorp.suiteapi.common.paging.SortInfo
All Implemented Interfaces:
ReadOnlySortInfo, Serializable

@Entity @GwtCompatible public final class SortInfo extends Object implements ReadOnlySortInfo, Serializable
This class is available as a preview of functionality that will be added to the supported public API in a future release. While it is in the preview phase, it is subject to change or removal without deprecation or notice. Although notice of change is not guaranteed, we will try to let developers know of major changes through announcements in release notes. This class is used as an argument for functions that sort a data set.
See Also:
  • Field Details

  • Constructor Details

    • SortInfo

      public SortInfo()
      Should not be used, only exposed for serializers that require a public parameterless constructor.
    • SortInfo

      public SortInfo(String field, boolean ascending)
      Parameters:
      field - the field to sort by. May be a simple field name, or dot notation to specify a subfield (e.g., "complexField.subField")
      ascending - if true, indicates that the sort on getField() should be in ascending order. If false, indicates that the sort should be in descending order.
  • Method Details

    • getField

      public String getField()
      Returns the field to sort by. May be a simple field name, or dot notation to specify a subfield (e.g., "complexField.subField")
      Specified by:
      getField in interface ReadOnlySortInfo
    • isAscending

      public boolean isAscending()
      Returns a boolean indicating whether sort on getField() should be in ascending or descending order. If true, indicates that the sort should be in ascending order. If false, indicates that the sort should be in descending order.
      Specified by:
      isAscending in interface ReadOnlySortInfo
    • asc

      public static SortInfo asc(String field)
      Convenience method for returning a SortInfo with ascending sort.
    • desc

      public static SortInfo desc(String field)
      Convenience method for returning a SortInfo with descending sort.
    • toString

      public String toString()
      Returns a string representation of the SortInfo
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object
    • equals

      public boolean equals(Object obj)
      Returns a boolean value indicating whether the given object is equal to this object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if both objects are equal, otherwise false
    • fieldEqualsPredicate

      public static com.google.common.base.Predicate<SortInfo> fieldEqualsPredicate(String targetFieldName)
      Returns a predicate that will return true when the field of a SortInfo object equals the given field name.