Class BuilderUtils
- java.lang.Object
 - 
- com.atlassian.confluence.api.model.reference.BuilderUtils
 
 
- 
public class BuilderUtils extends Object
A wrapper around ImmutableList builder that produces immutable lists if elements are added to the builder or a collapsed list otherwise. 
- 
- 
Constructor Summary
Constructors Constructor Description BuilderUtils() 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> List<T>collapsedList()Create a new (empty) collapsed model list.static <T> List<T>collapsedList(Navigation.Builder navBuilder)Create a new (empty) collapsed model list, with a navigation builder set.static <K,V>
Map<K,V>collapsedMap()Create a new (empty) collapsed model map.static <K,V>
Map<K,V>collapsedMap(Navigation.Builder navBuilder)Create a new (empty) collapsed model map, with a navigation builder set.static <T> PageResponse<T>collapsedPageResponse(Navigation.Builder navBuilder)static <K,V>
Map<K,V>modelMap(ModelMapBuilder<? extends K,? extends V> mapBuilder)All API Model maps must be Immutable and either:static <K,V>
Map<K,V>modelMap(com.google.common.collect.ImmutableMap.Builder<? extends K,? extends V> mapBuilder)Deprecated.since 5.6 usemodelMap(ModelMapBuilder)static <K,V>
Map<K,V>modelMap(Map<? extends K,? extends V> map)All API Model maps must be Immutable and either: 
 - 
 
- 
- 
Method Detail
- 
collapsedPageResponse
public static <T> PageResponse<T> collapsedPageResponse(Navigation.Builder navBuilder)
 
- 
collapsedList
public static <T> List<T> collapsedList()
Create a new (empty) collapsed model list.(If you want to add entries to a list, see
ModelListBuilder.)- See Also:
 ModelListBuilder
 
- 
collapsedList
public static <T> List<T> collapsedList(Navigation.Builder navBuilder)
Create a new (empty) collapsed model list, with a navigation builder set.(If you want to add entries to a list, see
ModelListBuilder.)- See Also:
 ModelListBuilder
 
- 
collapsedMap
public static <K,V> Map<K,V> collapsedMap()
Create a new (empty) collapsed model map.(If you want to add entries to a map, see
modelMap(Map)orModelMapBuilder.)- See Also:
 ModelMapBuilder
 
- 
collapsedMap
public static <K,V> Map<K,V> collapsedMap(Navigation.Builder navBuilder)
Create a new (empty) collapsed model map, with a navigation builder set.(If you want to add entries to a map, see
modelMap(Map)orModelMapBuilder.)- See Also:
 ModelMapBuilder
 
- 
modelMap
public static <K,V> Map<K,V> modelMap(ModelMapBuilder<? extends K,? extends V> mapBuilder)
All API Model maps must be Immutable and either:1. Collapsed if null, or 2. RestEnrichable
This method *must* be called when assigning to a model map from a map builder. It is guaranteed to create a correct map from any input.
- Returns:
 - an immutable, API model-friendly map
 - See Also:
 ModelMapBuilder
 
- 
modelMap
@Deprecated public static <K,V> Map<K,V> modelMap(com.google.common.collect.ImmutableMap.Builder<? extends K,? extends V> mapBuilder)
Deprecated.since 5.6 usemodelMap(ModelMapBuilder) 
- 
modelMap
public static <K,V> Map<K,V> modelMap(Map<? extends K,? extends V> map)
All API Model maps must be Immutable and either:1. Collapsed if null, or 2. RestEnrichable
This method *must* be called when assigning to a model map. It is guaranteed to create a correct map from any input.
- Returns:
 - an immutable, API model-friendly map
 
 
 - 
 
 -