Class Expansions
- java.lang.Object
-
- com.atlassian.confluence.api.model.Expansions
-
@ExperimentalApi public class Expansions extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static ExpansionsEMPTY
-
Constructor Summary
Constructors Constructor Description Expansions(Expansion... expansions)Expansions(Iterable<Expansion> expansions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExpand(String propertyName)voidcheckRecursiveExpansion(String expansion)Checks to see if the passed in expansion string is expanded again somewhere in the expansions map.static Stringencode(String expand)Encode expand string to a format that conformsDefaultExpandParameter.ExpandKeyReplace colon to __ and everything except colon, underscore and a-zA-Z0-9 to _ for expand key Remove everything except 0-9, :, -, | for indexesbooleanequals(Object o)ExpansionsgetSubExpansions(String propertyName)inthashCode()booleanisEmpty()Expansion[]merge(Expansion[] expansions)Expansionsmerge(Expansions expansions)static Expansionsof(String... expansionStr)Expansionsprepend(String propertyName)Create a new Expansions that prepends the propertyName to the path of all expansions represented in this Expansions object.Expansion[]toArray()StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final Expansions EMPTY
-
-
Method Detail
-
of
public static Expansions of(String... expansionStr)
-
merge
public Expansions merge(Expansions expansions)
-
canExpand
public boolean canExpand(String propertyName)
-
getSubExpansions
public Expansions getSubExpansions(String propertyName)
-
prepend
public Expansions prepend(String propertyName)
Create a new Expansions that prepends the propertyName to the path of all expansions represented in this Expansions object.The new set of expansions will answer true to canExpand(propertyName) and getSubExpansions(propertyName) will return the original set of expansions.
- Parameters:
propertyName- - the propertyName to prepend to the set of expansions- Returns:
- a new set of expansions with the propertyName at the root of the expansions.
-
toArray
public Expansion[] toArray()
-
isEmpty
public boolean isEmpty()
-
checkRecursiveExpansion
public void checkRecursiveExpansion(String expansion)
Checks to see if the passed in expansion string is expanded again somewhere in the expansions map. This check is used to prevent recursive expansions.- Parameters:
expansion-
-
encode
public static String encode(String expand)
Encode expand string to a format that conformsDefaultExpandParameter.ExpandKeyReplace colon to __ and everything except colon, underscore and a-zA-Z0-9 to _ for expand key Remove everything except 0-9, :, -, | for indexes- Parameters:
expand- single expand string that needs to encode- Returns:
- encoded expand string
-
-