Class ModelListBuilder<T>
java.lang.Object
com.atlassian.confluence.api.model.reference.ModelListBuilder<T>
Assists in building fields that may be either a list of items or an explicit CollapsedList.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the list.Replaces any existing contents in this builder with the contents of the list.static <T> ModelListBuilder<T>
Create a new builder, expanded by defaultstatic <T> ModelListBuilder<T>
Create a new builder, collapsed by defaultAdd all items in the iterable to this builder.
-
Method Details
-
newInstance
Create a new builder, collapsed by default -
newExpandedInstance
Create a new builder, expanded by default -
copy
Replaces any existing contents in this builder with the contents of the list.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.
-
putAll
Add all items in the iterable to this builder.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.
- Returns:
- this builder
-
build
Build the list.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.
-