Class PagingInfo
java.lang.Object
com.appiancorp.suiteapi.common.paging.PagingInfo
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 Summary
-
Constructor Summary
ConstructorDescriptionShould not be used, only exposed for serializers that require a public parameterless constructor.PagingInfo
(int startIndex, int batchSize) PagingInfo
(int startIndex, int batchSize, SortInfo sort) PagingInfo
(int startIndex, int batchSize, SortInfo... sort) PagingInfo
(int startIndex, int batchSize, String sortField, boolean ascending) PagingInfo
(int startIndex, int batchSize, List<SortInfo> sort) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns a boolean value indicating whether the given object is equal to this object.int
Returns the number of results to return in one page.getSort()
Returns the sort expressions that are applied before paging.int
Returns the index from which to start paging.int
hashCode()
Returns a hash code value for the object.boolean
hasSort()
Returnstrue
if a sort is configured (ie,getSort()
is non-empty).toString()
Returns a string representation of thePagingInfo
The caller assumes that thispagingInfo
has a 1-based start index.
-
Field Details
-
LOCAL_PART
- See Also:
-
QNAME
-
UNLIMITED_BATCH_SIZE
public static final int UNLIMITED_BATCH_SIZEUse as the value for thebatchSize
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
- 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
- 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
- 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 onsortField
should be in ascending order. If false, indicates that the sort should be in descending order.
-
PagingInfo
- 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
Returns the sort expressions that are applied before paging. -
hasSort
public boolean hasSort()Returnstrue
if a sort is configured (ie,getSort()
is non-empty). -
toString
Returns a string representation of thePagingInfo
-
toZeroBased
The caller assumes that thispagingInfo
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 thispagingInfo
was actually one- based. -
toOneBased
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
Returns a boolean value indicating whether the given object is equal to this object.
-