Package rs.jerseyclient.data
Class ResultList<T>
java.lang.Object
rs.jerseyclient.data.ResultList<T>
- Type Parameters:
T- the type of result
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>
Special list that also holds page information.
The class is usually required for correct JSON (de)serialization while easing the use.
- Author:
- ralph
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ResultList(List<T> results, PageInfo pageInfo) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanvoidget(int index) intReturns the number of the current page.intReturns the results page size.intReturns the total number of results.intReturns the total number of pages.inthashCode()intbooleanisEmpty()iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanvoidreplaceAll(UnaryOperator<T> operator) booleanretainAll(Collection<?> c) intsize()voidsort(Comparator<? super T> c) stream()subList(int fromIndex, int toIndex) Object[]toArray()<X> X[]toArray(IntFunction<X[]> generator) <X> X[]toArray(X[] a)
-
Constructor Details
-
ResultList
public ResultList()Default constructor. -
ResultList
Constructor.- Parameters:
results- - results of the responsepageInfo- - page information
-
-
Method Details
-
forEach
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <X> X[] toArray(X[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
replaceAll
- Specified by:
replaceAllin interfaceList<T>
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
sort
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
get
-
set
-
add
-
removeIf
- Specified by:
removeIfin interfaceCollection<T>
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>
-
subList
-
spliterator
- Specified by:
spliteratorin interfaceCollection<T>- Specified by:
spliteratorin interfaceIterable<T>- Specified by:
spliteratorin interfaceList<T>
-
stream
- Specified by:
streamin interfaceCollection<T>
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<T>
-
getPageSize
public int getPageSize()Returns the results page size.- Returns:
- the results page size
-
getTotalElements
public int getTotalElements()Returns the total number of results.- Returns:
- the total number of results
-
getTotalPages
public int getTotalPages()Returns the total number of pages.- Returns:
- the total number of pages
-
getPageNumber
public int getPageNumber()Returns the number of the current page.- Returns:
- the number of the current page
-