T
- The domain object type stored in this list.public abstract class PaginatedList<T> extends Object implements List<T>
Pages of results are fetched lazily from DynamoDB as they are needed. Some
methods, such as size()
and
toArray()
, require fetching the entire result set
eagerly. See the javadoc of individual methods for details on which are lazy.
Constructor and Description |
---|
PaginatedList(DynamoDBMapper mapper,
Class<T> clazz,
AmazonDynamoDB dynamo)
Constructs a PaginatedList instance using the default PaginationLoadingStrategy
|
PaginatedList(DynamoDBMapper mapper,
Class<T> clazz,
AmazonDynamoDB dynamo,
DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
Constructs a PaginatedList instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int arg0,
T arg1) |
boolean |
add(T arg0) |
boolean |
addAll(Collection<? extends T> arg0) |
boolean |
addAll(int arg0,
Collection<? extends T> arg1) |
void |
clear() |
boolean |
contains(Object arg0)
Returns whether the collection contains the given element.
|
boolean |
containsAll(Collection<?> arg0) |
T |
get(int n)
Returns the Nth element of the list.
|
int |
indexOf(Object arg0)
Returns the first index of the object given in the list.
|
boolean |
isEmpty()
Returns whether the collection is empty.
|
Iterator<T> |
iterator()
Returns an iterator over this list that lazily initializes results as
necessary.
|
int |
lastIndexOf(Object arg0) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int arg0) |
void |
loadAllResults()
Eagerly loads all results for this list.
|
T |
remove(int arg0) |
boolean |
remove(Object arg0) |
boolean |
removeAll(Collection<?> arg0) |
boolean |
retainAll(Collection<?> arg0) |
T |
set(int arg0,
T arg1) |
int |
size() |
List<T> |
subList(int arg0,
int arg1)
Returns a sub-list in the range specified, loading more results as
necessary.
|
Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public PaginatedList(DynamoDBMapper mapper, Class<T> clazz, AmazonDynamoDB dynamo)
public PaginatedList(DynamoDBMapper mapper, Class<T> clazz, AmazonDynamoDB dynamo, DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
mapper
- The mapper for marshalling DynamoDB attributes into objects.clazz
- The class of the annotated model.dynamo
- The DynamoDB client for making low-level request calls.paginationLoadingStrategy
- The strategy used for loading paginated results. Caller has to
explicitly set this parameter, since the DynamoDBMapperConfig
set in the mapper is not accessible here. If null value is
provided, LAZY_LOADING will be set by default.public void loadAllResults()
Not supported in ITERATION_ONLY mode.
public Iterator<T> iterator()
If it is configured with ITERATION_ONLY mode, then the iterator could be only retrieved once, and any previously loaded results will be cleared in the memory during the iteration.
public boolean isEmpty()
Not supported in ITERATION_ONLY mode.
public T get(int n)
Not supported in ITERATION_ONLY mode.
public boolean contains(Object arg0)
Not supported in ITERATION_ONLY mode.
public List<T> subList(int arg0, int arg1)
Not supported in ITERATION_ONLY mode.
public int indexOf(Object arg0)
Not supported in ITERATION_ONLY mode.
public int size()
public boolean containsAll(Collection<?> arg0)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public int lastIndexOf(Object arg0)
lastIndexOf
in interface List<T>
public Object[] toArray()
public <X> X[] toArray(X[] a)
public ListIterator<T> listIterator()
listIterator
in interface List<T>
public ListIterator<T> listIterator(int arg0)
listIterator
in interface List<T>
public boolean remove(Object arg0)
public boolean removeAll(Collection<?> arg0)
public boolean retainAll(Collection<?> arg0)
public boolean add(T arg0)
public boolean addAll(Collection<? extends T> arg0)
public boolean addAll(int arg0, Collection<? extends T> arg1)