Package de.digitalcollections.model.list
Class ListResponse<T,R extends ListRequest>
java.lang.Object
de.digitalcollections.model.list.ListResponse<T,R>
- Type Parameters:
T
- object type of list items
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
BucketsResponse
,PageResponse
Container for list information.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionListResponse
(List<T> content, R request) Constructor with the given content and the given governingListRequest
.ListResponse
(List<T> content, R request, String executedSearchTerm) Constructor with the given content and the given governingListRequest
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
Returns the total amount of elements.boolean
int
hashCode()
protected void
init()
iterator()
void
setContent
(List<T> content) Allows to set the content (needed in case of content has to be converted/casted)void
setExecutedSearchTerm
(String executedSearchTerm) void
setRequest
(R request) void
setTotalElements
(long totalElements) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
-
executedSearchTerm
-
request
-
total
protected long total
-
-
Constructor Details
-
ListResponse
public ListResponse() -
ListResponse
Constructor with the given content and the given governingListRequest
.- Parameters:
content
- the content of this list, must not be null.request
- the request information, can be null.
-
ListResponse
Constructor with the given content and the given governingListRequest
.- Parameters:
content
- the content of this list, must not be null.request
- the request information, can be null.executedSearchTerm
- finally executed search term based on given search term (e.g. after escaping special characters etc.)
-
-
Method Details
-
equals
-
getContent
- Returns:
- the content as
List
.
-
getExecutedSearchTerm
-
getRequest
- Returns:
- the request used to get this response
-
getSorting
- Returns:
- the sorting parameters for the
ListResponse
.
-
getTotalElements
public long getTotalElements()Returns the total amount of elements.- Returns:
- the total amount of elements
-
hasContent
public boolean hasContent()- Returns:
- whether the
ListResponse
has content at all.
-
hashCode
public int hashCode() -
init
protected void init() -
iterator
-
setContent
Allows to set the content (needed in case of content has to be converted/casted)- Parameters:
content
- list of content/objects
-
setExecutedSearchTerm
-
setRequest
-
setTotalElements
public void setTotalElements(long totalElements) -
toString
-