Class RestList<T>
- java.lang.Object
-
- com.atlassian.confluence.rest.api.model.RestObject
-
- com.atlassian.confluence.rest.api.model.RestList<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
PageResponse<T>
,NavigationAware
,Iterable<T>
,Collection<T>
,List<T>
@ExperimentalApi public final class RestList<T> extends RestObject implements PageResponse<T>, List<T>, NavigationAware
The RestList participates in our collection serialization by jackson, and allows collections to be enriched with extra properties during serialization. It wraps a pageResponse, and allows extra fields to be added as jsonProperties. This map of properties is added to by the property enrichers, and is ultimately used by the RestEntitySerializer to convert the object to json
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestList.Builder<T>
-
Nested classes/interfaces inherited from class com.atlassian.confluence.rest.api.model.RestObject
RestObject.Properties
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.rest.api.model.RestObject
jsonProperties
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RestList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(int index, T element)
boolean
add(T o)
boolean
addAll(int index, Collection<? extends T> c)
boolean
addAll(Collection<? extends T> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
static <T> RestList<T>
createRestList(PageRequest pageRequest, PageResponse<T> pageResponse)
Deprecated.since 5.6.5.static <T> RestList<T>
createRestList(PageRequest request, List<T> results, boolean hasMore)
Deprecated.since 5.6.5.static <T> RestList<T>
createRestList(PageResponse<T> pageResponse)
Deprecated.since 5.6.5.boolean
equals(Object obj)
T
get(int index)
Cursor
getNextCursor()
PageRequest
getPageRequest()
PageResponse<T>
getPageResponse()
Cursor
getPrevCursor()
List<T>
getResults()
int
hashCode()
boolean
hasMore()
Indicates whether the source has more results after this page.int
indexOf(Object o)
boolean
isEmpty()
Iterator<T>
iterator()
int
lastIndexOf(Object o)
ListIterator<T>
listIterator()
ListIterator<T>
listIterator(int index)
static <T> RestList.Builder<T>
newRestList()
static <T> RestList.Builder<T>
newRestList(PageRequest pageRequest)
static <T> RestList.Builder<T>
newRestList(PageResponse<T> response)
T
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
Navigation.Builder
resolveNavigation(NavigationService navigationService)
boolean
retainAll(Collection<?> c)
T
set(int index, T element)
int
size()
List<T>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<A> A[]
toArray(A[] a)
String
toString()
-
Methods inherited from class com.atlassian.confluence.rest.api.model.RestObject
addProperty, getProperties, getProperty, hasProperty, properties, putProperties, putProperty, putProperty, removeProperty
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
newRestList
public static <T> RestList.Builder<T> newRestList(PageRequest pageRequest)
-
newRestList
public static <T> RestList.Builder<T> newRestList(PageResponse<T> response)
-
newRestList
public static <T> RestList.Builder<T> newRestList()
-
createRestList
@Deprecated public static <T> RestList<T> createRestList(PageResponse<T> pageResponse)
Deprecated.since 5.6.5. UsenewRestList(com.atlassian.confluence.api.model.pagination.PageResponse)
instead.
-
createRestList
@Deprecated public static <T> RestList<T> createRestList(PageRequest pageRequest, PageResponse<T> pageResponse)
Deprecated.since 5.6.5. UsenewRestList(com.atlassian.confluence.api.model.pagination.PageResponse)
instead.
-
createRestList
@Deprecated public static <T> RestList<T> createRestList(PageRequest request, List<T> results, boolean hasMore)
Deprecated.since 5.6.5. UsenewRestList(PageRequest)
instead.
-
getPageRequest
public PageRequest getPageRequest()
- Specified by:
getPageRequest
in interfacePageResponse<T>
- Returns:
- the request used to produce this response
-
getPageResponse
public PageResponse<T> getPageResponse()
-
resolveNavigation
public Navigation.Builder resolveNavigation(NavigationService navigationService)
- Specified by:
resolveNavigation
in interfaceNavigationAware
-
toArray
public Object[] toArray()
-
add
public boolean add(T o)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
addAll
public boolean addAll(Collection<? extends T> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
clear
public void clear()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<T>
-
listIterator
public ListIterator<T> listIterator()
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
public ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in interfaceList<T>
-
toArray
public <A> A[] toArray(A[] a)
-
getResults
public List<T> getResults()
- Specified by:
getResults
in interfacePageResponse<T>
- Returns:
- the results
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in interfacePageResponse<T>
- Returns:
- the number of results in this page of results
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
hasMore
public boolean hasMore()
Description copied from interface:PageResponse
Indicates whether the source has more results after this page.- Specified by:
hasMore
in interfacePageResponse<T>
- Returns:
- true if there are more results
-
getNextCursor
public Cursor getNextCursor()
- Specified by:
getNextCursor
in interfacePageResponse<T>
- Returns:
- the identifier which is used to skip results from a previous query when paginating in forward direction.
-
getPrevCursor
public Cursor getPrevCursor()
- Specified by:
getPrevCursor
in interfacePageResponse<T>
- Returns:
- the identifier which is used to skip results from a previous query when paginating in backward direction.
-
equals
public boolean equals(Object obj)
-
-