Class PaginableWithDelegate<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableWithDelegate<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,Paginable<T>
public class PaginableWithDelegate<T> extends ArrayList<T> implements Paginable<T>
Paginable object that uses a delegate to handle pagination.- Since:
- 5.8
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description PaginableWithDelegate(Paginable<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<QuickFilter>
getActiveQuickFilters()
Map<String,Aggregate<? extends Bucket>>
getAggregates()
List<QuickFilter>
getAvailableQuickFilters()
long
getCurrentPageIndex()
Returns the current page index as a zero-based integer.long
getCurrentPageOffset()
Returns the offset (starting from 0) of the first element in the current page orUNKNOWN_SIZE
.long
getCurrentPageSize()
Returns the number of elements in current page.String
getErrorMessage()
long
getMaxPageSize()
Returns the max number of results per page.long
getNumberOfPages()
Returns the total number of pages or 0 if number of pages is unknown.long
getPageSize()
Returns the number of results per page.long
getResultsCount()
Returns the number of result elements if available or a negative value if it is unknown:UNKNOWN_SIZE
if it is unknown as query was not done, and since 5.5,UNKNOWN_SIZE_AFTER_QUERY
if it is still unknown after query was done.long
getResultsCountLimit()
Limit of number of results beyond which the page provider may not be able to computePaginable.getResultsCount()
or navigate.boolean
hasAggregateSupport()
boolean
hasError()
boolean
isLastPageAvailable()
Returns a boolean expressing if the last page can be displayed.boolean
isNextPageAvailable()
Returns a boolean expressing if there are further pages.boolean
isPreviousPageAvailable()
Returns a boolean expressing if there is a previous page.boolean
isSortable()
Returns if this provider is sortable.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
getPageSize
public long getPageSize()
Description copied from interface:Paginable
Returns the number of results per page. 0 means no pagination.- Specified by:
getPageSize
in interfacePaginable<T>
-
getMaxPageSize
public long getMaxPageSize()
Description copied from interface:Paginable
Returns the max number of results per page. 0 means no pagination.If page size is greater than this maximum value, it will be taken into account instead.
- Specified by:
getMaxPageSize
in interfacePaginable<T>
-
getResultsCount
public long getResultsCount()
Description copied from interface:Paginable
Returns the number of result elements if available or a negative value if it is unknown:UNKNOWN_SIZE
if it is unknown as query was not done, and since 5.5,UNKNOWN_SIZE_AFTER_QUERY
if it is still unknown after query was done.- Specified by:
getResultsCount
in interfacePaginable<T>
-
getNumberOfPages
public long getNumberOfPages()
Description copied from interface:Paginable
Returns the total number of pages or 0 if number of pages is unknown.- Specified by:
getNumberOfPages
in interfacePaginable<T>
-
isNextPageAvailable
public boolean isNextPageAvailable()
Description copied from interface:Paginable
Returns a boolean expressing if there are further pages.- Specified by:
isNextPageAvailable
in interfacePaginable<T>
-
isLastPageAvailable
public boolean isLastPageAvailable()
Description copied from interface:Paginable
Returns a boolean expressing if the last page can be displayed.- Specified by:
isLastPageAvailable
in interfacePaginable<T>
-
isPreviousPageAvailable
public boolean isPreviousPageAvailable()
Description copied from interface:Paginable
Returns a boolean expressing if there is a previous page.- Specified by:
isPreviousPageAvailable
in interfacePaginable<T>
-
getCurrentPageSize
public long getCurrentPageSize()
Description copied from interface:Paginable
Returns the number of elements in current page.- Specified by:
getCurrentPageSize
in interfacePaginable<T>
-
getCurrentPageIndex
public long getCurrentPageIndex()
Description copied from interface:Paginable
Returns the current page index as a zero-based integer.- Specified by:
getCurrentPageIndex
in interfacePaginable<T>
-
isSortable
public boolean isSortable()
Description copied from interface:Paginable
Returns if this provider is sortable.- Specified by:
isSortable
in interfacePaginable<T>
-
getErrorMessage
public String getErrorMessage()
- Specified by:
getErrorMessage
in interfacePaginable<T>
-
getAggregates
public Map<String,Aggregate<? extends Bucket>> getAggregates()
- Specified by:
getAggregates
in interfacePaginable<T>
-
hasAggregateSupport
public boolean hasAggregateSupport()
- Specified by:
hasAggregateSupport
in interfacePaginable<T>
-
getActiveQuickFilters
public List<QuickFilter> getActiveQuickFilters()
- Specified by:
getActiveQuickFilters
in interfacePaginable<T>
-
getAvailableQuickFilters
public List<QuickFilter> getAvailableQuickFilters()
- Specified by:
getAvailableQuickFilters
in interfacePaginable<T>
-
getCurrentPageOffset
public long getCurrentPageOffset()
Description copied from interface:Paginable
Returns the offset (starting from 0) of the first element in the current page orUNKNOWN_SIZE
.- Specified by:
getCurrentPageOffset
in interfacePaginable<T>
-
getResultsCountLimit
public long getResultsCountLimit()
Description copied from interface:Paginable
Limit of number of results beyond which the page provider may not be able to computePaginable.getResultsCount()
or navigate.Requesting results beyond this limit may result in error. When
Paginable.getResultsCount()
is negative, it means there may be more results than this limit.0 means there is no limit.
- Specified by:
getResultsCountLimit
in interfacePaginable<T>
-
-