|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.rest.api.expand.SimpleListWrapper<T>
public class SimpleListWrapper<T>
This is a list wrapper that works by wrapping a java.util.Collection that has been eagerly loaded into memory. As such, it does not take full advantage of the "expandable" concepts since it requires callers to have previously loaded the entire data set into memory, but it has the advantage of being simple to implement.
This class makes a shallow copy of the wrapped collection.
Expandable
Constructor Summary | |
---|---|
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. |
Method Summary | ||
---|---|---|
static
|
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
|
of(List<T> list)
Returns a new SimpleListWrapper that is backed by the given collection. |
|
static
|
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
|
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
|
of(T... elements)
Returns a new SimpleListWrapper that wraps the given elements. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 setMethod Detail |
---|
public static <T> SimpleListWrapper<T> empty()
T
- the type of the list element
public static <T> SimpleListWrapper<T> of(T... elements)
T
- the type of the list elementelements
- the elements to wrap
public static <T> SimpleListWrapper<T> of(List<T> list)
T
- the type of the list elementlist
- the backing Collection
public 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 null
public 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 set
public 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>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |