T
- the type of objects returned on this list.@StableMinor(version="12.3", sinceVersion="8.0") public abstract class ListResult<T> extends Object
When using this class, it must be extended the method getItems()
overridden, so JAXB can correctly marshal the list item type.
annotation to include the element type used in the list,
so it can be marshaled correctly.
After creating an instance of this class, its values may be set using
init(UriInfo, List, Integer, Integer, Integer)
or individually
with set methods.
Modifier | Constructor and Description |
---|---|
protected |
ListResult() |
Modifier and Type | Method and Description |
---|---|
protected String |
createFirstUrl(UriInfo uriInfo)
Method called by
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the first page of the result. |
protected String |
createLastUrl(UriInfo uriInfo)
Method called by
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the last page of the result. |
protected String |
createNextUrl(UriInfo uriInfo)
Method called by
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the next page of the result. |
protected String |
createPreviousUrl(UriInfo uriInfo)
Method called by
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the previous page of the result. |
String |
getFirstUrl()
Returns the URL the corresponds to the first page of this list.
|
List<T> |
getItems()
Returns the backing list object for this result list.
|
String |
getLastUrl()
Returns the URL the corresponds to the last page of this list.
|
Integer |
getMaxResults()
Returns the maximum number of results requested to be returned in this
ListResult.
|
String |
getNextUrl()
Returns the URL the corresponds to the next page of this list.
|
String |
getPreviousUrl()
Returns the URL the corresponds to the previous page of this list.
|
Integer |
getStartAt()
Returns the index of the first result being returned in the current
ListResult.
|
Integer |
getTotalCount()
Returns the total number of items that exist, although not all of them
may be returned in this ListResult.
|
void |
init(UriInfo uriInfo,
List<T> items,
Integer totalCount,
Integer maxResults,
Integer startAt)
Initializes all fields of this list result based on the given
information.
|
void |
setFirstUrl(String firstUrl)
Sets the URL the corresponds to the first page of this list.
|
void |
setItems(List<T> items)
Sets the backing list object for this result list.
|
void |
setLastUrl(String lastUrl)
Sets the URL the corresponds to the last page of this list.
|
void |
setMaxResults(Integer maxResults)
Sets the maximum number of results requested to be returned in this
ListResult.
|
void |
setNextUrl(String nextUrl)
Sets the URL the corresponds to the next page of this list.
|
void |
setPreviousUrl(String previousUrl)
Sets the URL the corresponds to the previous page of this list.
|
void |
setStartAt(Integer startAt)
Sets the index of the first result being returned in the current
ListResult.
|
void |
setTotalCount(Integer totalCount)
Sets the total number of items that exist, although not all of them
may be returned in this ListResult.
|
public void init(UriInfo uriInfo, List<T> items, Integer totalCount, Integer maxResults, Integer startAt)
uriInfo
- information about the current requested URL.items
- a list containing the objects that are part of the result.totalCount
- the total number of existing objects (including objects
not included in the current pagination), or null
if it is unknown.maxResults
- the maximum number of results per pagination that
was used when generating the data
, or null
if there is
no pagination.startAt
- the first index (zero-based) of the objects in the current
pagination, or null
if there is no pagination.public Integer getMaxResults()
null
if there was no maximum number specified.public void setMaxResults(Integer maxResults)
maxResults
- the maximum number of results requested to be returned, or
null
if there is no maximum number specified.public Integer getStartAt()
null
if it was not specified.public void setStartAt(Integer startAt)
startAt
- the index zero-based, or null
if it was not specified.public Integer getTotalCount()
null
if unknown.public void setTotalCount(Integer totalCount)
totalCount
- the total number of items, or null
if unknown.public String getFirstUrl()
public void setFirstUrl(String firstUrl)
firstUrl
- the URL the corresponds to the first page of this list.public String getNextUrl()
public void setNextUrl(String nextUrl)
nextUrl
- the URL the corresponds to the next page of this list.public String getPreviousUrl()
public void setPreviousUrl(String previousUrl)
previousUrl
- the URL the corresponds to the previous page of this list.public String getLastUrl()
public void setLastUrl(String lastUrl)
lastUrl
- the URL the corresponds to the last page of this list.public List<T> getItems()
public void setItems(List<T> items)
items
- the backing list object for this result list.protected String createFirstUrl(UriInfo uriInfo)
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the first page of the result.
This method can be overridden as a way to alter the generation of the
first URL without stopping to use the init
method.
uriInfo
- information about the requested URI.null
if there is no first page.protected String createNextUrl(UriInfo uriInfo)
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the next page of the result.
This method can be overridden as a way to alter the generation of the
next URL without stopping to use the init
method.
uriInfo
- information about the requested URI.null
if there is no next page.protected String createPreviousUrl(UriInfo uriInfo)
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the previous page of the result.
This method can be overridden as a way to alter the generation of the
previous URL without stopping to use the init
method.
uriInfo
- information about the requested URI.null
if there is no previous page.protected String createLastUrl(UriInfo uriInfo)
init(UriInfo, List, Integer, Integer, Integer)
for generating the URL that corresponds to the last page of the result.
This method can be overridden as a way to alter the generation of the
last URL without stopping to use the init
method.
uriInfo
- information about the requested URI.null
if there is no last page.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.