T
- the generic type of contained elementspublic class PartialList<T> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
PartialList.Relation
This enum exists to replicate Lucene's total hits relation in a back-end agnostic way.
|
Constructor and Description |
---|
PartialList()
Instantiates a new PartialList.
|
PartialList(List<T> list,
long offset,
long pageSize,
long totalSize,
PartialList.Relation totalSizeRelation)
Instantiates a new PartialList.
|
Modifier and Type | Method and Description |
---|---|
T |
get(int index)
Retrieves the element at the specified index
|
List<T> |
getList()
Retrieves the limited list view.
|
long |
getOffset()
Retrieves the offset of the first element of the view.
|
long |
getPageSize()
Retrieves the number of elements this PartialList contains.
|
String |
getScrollIdentifier()
Retrieve the scroll identifier to make it possible to continue a scrolling list query
|
String |
getScrollTimeValidity()
Retrieve the value of the scroll time validity to make it possible to continue a scrolling list query
|
long |
getTotalSize()
Retrieves the total size of elements in the original List.
|
PartialList.Relation |
getTotalSizeRelation()
Retrieve the relation to the total site, wether it is equal to or greater than the value stored in the
totalSize property.
|
void |
setList(List<T> list)
Sets the view list.
|
void |
setOffset(long offset) |
void |
setPageSize(long pageSize) |
void |
setScrollIdentifier(String scrollIdentifier) |
void |
setScrollTimeValidity(String scrollTimeValidity) |
void |
setTotalSize(long totalSize) |
void |
setTotalSizeRelation(PartialList.Relation totalSizeRelation) |
int |
size()
Retrieves the size of this PartialList.
|
public PartialList()
public PartialList(List<T> list, long offset, long pageSize, long totalSize, PartialList.Relation totalSizeRelation)
list
- the limited view into the bigger List this PartialList is representingoffset
- the offset of the first element in the viewpageSize
- the number of elements this PartialList containstotalSize
- the total size of elements in the original ListtotalSizeRelation
- the relation to the total size (equals or greater than)public List<T> getList()
size
elements starting from the offset
-th one from the original, larger listpublic void setList(List<T> list)
list
- the view list into the bigger List this PartialList is representingpublic long getOffset()
public void setOffset(long offset)
public long getPageSize()
public void setPageSize(long pageSize)
public long getTotalSize()
public void setTotalSize(long totalSize)
public int size()
getPageSize()
.public T get(int index)
index
- the index of the element to retrievepublic String getScrollIdentifier()
public void setScrollIdentifier(String scrollIdentifier)
public String getScrollTimeValidity()
public void setScrollTimeValidity(String scrollTimeValidity)
public PartialList.Relation getTotalSizeRelation()
public void setTotalSizeRelation(PartialList.Relation totalSizeRelation)
Copyright © 2014–2023 Apache Software Foundation. All rights reserved.