public class SimpleListWrapper<T> extends Object implements com.atlassian.plugins.rest.common.expand.entity.ListWrapper<T>
This class makes a shallow copy of the wrapped collection.
Expandable
Modifier | Constructor and Description |
---|---|
protected |
SimpleListWrapper(List<T> list,
Integer maxResults,
int size)
Creates a new SimpleListWrapper backed by the given list and returns at most maxResults items to the client.
|
Modifier and Type | Method and Description |
---|---|
static <T> SimpleListWrapper<T> |
empty()
Returns an empty SimpleListWrapper.
|
com.atlassian.plugins.rest.common.expand.entity.ListWrapperCallback<T> |
getCallback() |
int |
getMaxResults() |
com.atlassian.plugins.rest.common.expand.entity.ListWrapperCallback<T> |
getPagingCallback()
Returns a ListWrapperCallback that the REST plugin can use to retrieve elements having specific indexes.
|
int |
getSize() |
static <T> SimpleListWrapper<T> |
of(List<T> list)
Returns a new SimpleListWrapper that is backed by the given collection.
|
static <T> SimpleListWrapper<T> |
of(List<T> list,
Integer maxResults)
Returns a new SimpleListWrapper that is backed by the given list and returns at most maxResults items to the
client.
|
static <T> SimpleListWrapper<T> |
of(List<T> list,
Integer maxResults,
int size)
Returns a new SimpleListWrapper that is backed by the given list and returns at most maxResults items to the
client.
|
static <T> SimpleListWrapper<T> |
of(T... elements)
Returns a new SimpleListWrapper that wraps the given elements.
|
String |
toString() |
protected SimpleListWrapper(List<T> list, Integer maxResults, int size)
list
- a CollectionmaxResults
- the maximum number of results to return to the client in one callsize
- the size of the data setpublic static <T> SimpleListWrapper<T> empty()
T
- the type of the list elementpublic static <T> SimpleListWrapper<T> of(T... elements)
T
- the type of the list elementelements
- the elements to wrappublic static <T> SimpleListWrapper<T> of(List<T> list)
T
- the type of the list elementlist
- the backing Collectionpublic static <T> SimpleListWrapper<T> of(List<T> list, Integer maxResults)
T
- the type of the list elementlist
- the backing ListmaxResults
- the maximum number of results to return to the client in one call, or nullpublic static <T> SimpleListWrapper<T> of(List<T> list, Integer maxResults, int size)
T
- the type of the list elementlist
- the backing ListmaxResults
- the maximum number of results to return to the client in one callsize
- the size of the data setpublic com.atlassian.plugins.rest.common.expand.entity.ListWrapperCallback<T> getPagingCallback()
public int getSize()
public int getMaxResults()
public final com.atlassian.plugins.rest.common.expand.entity.ListWrapperCallback<T> getCallback()
getCallback
in interface com.atlassian.plugins.rest.common.expand.entity.ListWrapper<T>
Copyright © 2002-2017 Atlassian. All Rights Reserved.