public class ExpansionDepth extends java.lang.Object implements JsonSerializable
Modifier and Type | Method and Description |
---|---|
static ExpansionDepth |
block()
Blocks expansion unless forcefully removed.
|
static ExpansionDepth |
expand(int depth)
Depth to expand a given number of levels.
|
static ExpansionDepth |
expandAll()
Depth to expand all levels.
|
static ExpansionDepth |
forceExpand(int depth)
Depth to expand a given number of levels forcefully.
|
static ExpansionDepth |
forceExpandAll()
Depth to expand all levels forcefully.
|
int |
getDepth()
Returns the expansion depth.
|
ExpansionDepth |
getForNextDepth(ExpansionDepth parentDepth)
Gets the depth to use at the next step, based on the current depth and the parent depth.
|
ExpansionDepth |
getForStorage(ExpansionDepth previous)
Get the depth suited for storage.
|
boolean |
isAll()
Returns whether this depth expands all.
|
boolean |
isBlock()
Returns whether this depth is a block.
|
boolean |
isDeeperThan(ExpansionDepth other)
Returns whether this depth is deeper than the other, irregardless of forcing status.
|
boolean |
isExpanded()
Returns whether this depth is expanded.
|
boolean |
isForce()
Returns whether this depth forces expansion.
|
boolean |
isNone()
Returns whether this depth does not expand at all.
|
static ExpansionDepth |
none()
Depth to not expand anything.
|
ExpansionDepth |
unforce()
Unforces the expansion depth for storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromJson, toJson
public static ExpansionDepth forceExpandAll()
public static ExpansionDepth forceExpand(int depth)
depth
- The number of levels to expand. Must be at least 0.public static ExpansionDepth expandAll()
public static ExpansionDepth expand(int depth)
depth
- The number of levels to expand. Must be at least 0.public static ExpansionDepth none()
public static ExpansionDepth block()
public ExpansionDepth getForNextDepth(ExpansionDepth parentDepth)
parentDepth
- The parent depth to use.public ExpansionDepth unforce()
public ExpansionDepth getForStorage(ExpansionDepth previous)
previous
- The previous depth which was stored.public boolean isDeeperThan(ExpansionDepth other)
other
- The other depth.public boolean isBlock()
public boolean isForce()
public boolean isNone()
public boolean isAll()
public boolean isExpanded()
public int getDepth()
expand(int)
or forceExpand(int)
and returns
that given depth. If any of isAll()
or isNone()
or isBlock()
returns true, this value is meaningless.