Class RestPageModel<T>
- java.lang.Object
-
- com.atlassian.bamboo.rest.model.AbstractRestModel
-
- com.atlassian.bamboo.rest.model.pagination.RestPageModel<T>
-
- Type Parameters:
T
- type of page element
public class RestPageModel<T> extends AbstractRestModel
REST model representing a page resource.
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.rest.model.AbstractRestModel
self
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> RestPageModel<T>
expandable(@NotNull PageRequest pageRequest)
Construct a page model for an expandable result list, without any results yet.static <T> RestPageModel<T>
forItems(@NotNull PageRequest pageRequest, @NotNull Iterable<T> items)
Construct a page model for a result list.static <T> RestPageModel<T>
forItems(@NotNull PageRequest pageRequest, @NotNull Iterable<T> items, boolean more)
Construct a page model for a result list.int
getLimit()
Get the maximum number of items allowed/requested to be returned.@Nullable List<T>
getResults()
int
getStart()
Get the index this page starts from.boolean
isMore()
void
setNext(@Nullable String next)
void
setPrev(@Nullable String prev)
-
Methods inherited from class com.atlassian.bamboo.rest.model.AbstractRestModel
getSelf, setSelf
-
-
-
-
Method Detail
-
expandable
public static <T> RestPageModel<T> expandable(@NotNull @NotNull PageRequest pageRequest)
Construct a page model for an expandable result list, without any results yet.- Parameters:
pageRequest
- request
-
forItems
public static <T> RestPageModel<T> forItems(@NotNull @NotNull PageRequest pageRequest, @NotNull @NotNull Iterable<T> items)
Construct a page model for a result list.- Parameters:
pageRequest
- requestitems
- items for the page
-
forItems
public static <T> RestPageModel<T> forItems(@NotNull @NotNull PageRequest pageRequest, @NotNull @NotNull Iterable<T> items, boolean more)
Construct a page model for a result list.- Parameters:
pageRequest
- requestitems
- items for the pagemore
- true, if there are more results and the list is not complete
-
isMore
public boolean isMore()
-
getStart
public int getStart()
Get the index this page starts from. Data obtained from the page request used to construct this response.
-
getLimit
public int getLimit()
Get the maximum number of items allowed/requested to be returned. Data obtained from the page request used to construct this response.
-
setNext
public void setNext(@Nullable @Nullable String next)
-
setPrev
public void setPrev(@Nullable @Nullable String prev)
-
-