Class PagingInfo

java.lang.Object
com.appiancorp.suiteapi.common.paging.PagingInfo

@GwtCompatible public class PagingInfo extends Object
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 allow pagination of a data set, and contains parameters for paging and sorting. Validated in CanonicalGridFieldValidator.java
  • Field Details

    • LOCAL_PART

      public static final String LOCAL_PART
      See Also:
    • QNAME

      public static final QName QNAME
    • UNLIMITED_BATCH_SIZE

      public static final int UNLIMITED_BATCH_SIZE
      Use as the value for the batchSize parameter when the full result set should be returned. Use sparingly, as it may have a performance impact on large data sets.
      See Also:
  • Constructor Details

    • PagingInfo

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

      public PagingInfo(int startIndex, int batchSize)
      Parameters:
      startIndex - the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
      batchSize - the number of results to return in one page. If negative, the full result set should be returned.
    • PagingInfo

      public PagingInfo(int startIndex, int batchSize, List<SortInfo> sort)
      Parameters:
      startIndex - the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
      batchSize - the number of results to return in one page. If negative, the full result set should be returned.
      sort - the sort expressions to apply before paging.
    • PagingInfo

      public PagingInfo(int startIndex, int batchSize, SortInfo... sort)
      Parameters:
      startIndex - the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
      batchSize - the number of results to return in one page. If negative, the full result set should be returned.
      sort - the sort expressions to apply before paging.
    • PagingInfo

      public PagingInfo(int startIndex, int batchSize, String sortField, boolean ascending)
      Parameters:
      startIndex - the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
      batchSize - the number of results to return in one page. If negative, the full result set should be returned.
      sort - the sort expressions to apply before paging.
      sortField - 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 sortField should be in ascending order. If false, indicates that the sort should be in descending order.
    • PagingInfo

      public PagingInfo(int startIndex, int batchSize, SortInfo sort)
      Parameters:
      startIndex - the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
      batchSize - the number of results to return in one page. If negative, the full result set should be returned.
      sort - the sort expression to apply before paging.
  • Method Details

    • getStartIndex

      public int getStartIndex()
      Returns the index from which to start paging. This may be 0-based or 1-based depending on where this PagingInfo object will be used.
    • getBatchSize

      public int getBatchSize()
      Returns the number of results to return in one page. If negative, the full result set should be returned.
    • getSort

      public List<SortInfo> getSort()
      Returns the sort expressions that are applied before paging.
    • hasSort

      public boolean hasSort()
      Returns true if a sort is configured (ie, getSort() is non-empty).
    • toString

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

      public PagingInfo toZeroBased()
      The caller assumes that this pagingInfo has a 1-based start index. This returns a new PagingInfo with the startIndex decremented by 1 to be zero-based. No validation is performed to ensure that this pagingInfo was actually one- based.
    • toOneBased

      public PagingInfo toOneBased()
    • 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:
      o_ - the reference object with which to compare.
      Returns:
      true if both objects are equal, otherwise false