@ExperimentalApi public class Expansion extends Object
node
and any sub properties
will get collected in the subExpansions
If its the root node it will only have children e.g. "a.b,c.d" will become an Expansion with a root node ("ROOT"), with two sub nodes "a" and "c"
If its a sub node, it will have the name of the sub node, and its children. e.g. "a.c,a.b" will have "a" as the node and subExpansion of "c" and "b"
Modifier and Type | Field and Description |
---|---|
static String |
ROOT_NODE |
static Expansion |
SELF |
Modifier and Type | Method and Description |
---|---|
void |
addSubExpansion(Expansion expansion)
Adds a single sub expansion to this expansion.
|
void |
addSubExpansions(Collection<Expansion> expansions)
Adds sub expansions to this expansion.
|
boolean |
canExpand()
Check if the current property can be expanded
|
boolean |
canExpand(String name)
Check if the given property is a sub node of the current property
|
boolean |
equals(Object o) |
Expansion |
getExpansion(String name)
Get expansion at a specific sub node.
|
String |
getName() |
Expansion |
getSubExpansion(String name)
Get expansion at a specific sub node.
|
Collection<Expansion> |
getSubExpansions() |
boolean |
isRoot() |
static Expansion |
parse(String string)
Takes in expansion arguments and parses/splits/merges them into an expansion tree.
|
protected static Pair<String,String> |
toParts(String expansionString)
Split an expansion string into its first node and rest.
|
String |
toString()
Flattens the tree into a string format
|
public static final String ROOT_NODE
public static final Expansion SELF
@NotNull public static Expansion parse(@Nullable String string)
string
- to parse@NotNull public String getName()
public boolean isRoot()
@NotNull public Collection<Expansion> getSubExpansions()
public void addSubExpansions(@Nullable Collection<Expansion> expansions)
expansions
- to addpublic void addSubExpansion(@Nullable Expansion expansion)
expansion
- to addpublic boolean canExpand(@NotNull String name)
name
- to checkpublic boolean canExpand()
@NotNull public Expansion getExpansion(@NotNull String name)
Expansion.NONE
will be returned.name
- of the sub expansion to get@NotNull public Expansion getSubExpansion(@NotNull String name)
canExpand(String)
firstname
- of the sub expansion to getpublic String toString()
@NotNull protected static Pair<String,String> toParts(@NotNull String expansionString)
expansionString
- string to splitCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.