public class ModelListBuilder<T> extends Object
Modifier and Type | Method and Description |
---|---|
List<T> |
build()
Build the list.
|
ModelListBuilder<T> |
copy(Iterable<? extends T> toAdd)
Replaces any existing contents in this builder with the contents of the list.
|
static <T> ModelListBuilder<T> |
newExpandedInstance()
Create a new builder, expanded by default
|
static <T> ModelListBuilder<T> |
newInstance()
Create a new builder, collapsed by default
|
ModelListBuilder<T> |
putAll(Iterable<? extends T> toAdd)
Add all items in the iterable to this builder.
|
public static <T> ModelListBuilder<T> newInstance()
public static <T> ModelListBuilder<T> newExpandedInstance()
public ModelListBuilder<T> copy(Iterable<? extends T> toAdd)
If the iterable is a collapsed list, it will become the list to be returned by this builder.
Otherwise, all items from the iterable will be added to this builder, and it will be marked as expanded.
public ModelListBuilder<T> putAll(Iterable<? extends T> toAdd)
If the iterable is a collapsed list, it will become the list to be returned by this builder (which must currently be empty).
Otherwise, all items from the iterable will be added to this builder, and it will be marked as expanded.
public List<T> build()
If items have been added to the builder, or if this list was explicitly set to be expanded
via newExpandedInstance()
, an expanded list will be returned.
If not, a collapsed list will be returned.
Copyright © 2003–2019 Atlassian. All rights reserved.