Class ImmutableNode
- All Implemented Interfaces:
OptionalHeaderHolder, INode<ImmutableNode>, BlanknessRequestable
- Author:
- Silvan Wyss
-
Field Summary
FieldsFields inherited from class AbstractNode
CLOSED_BRACKET_CODE, COMMA_CODE, DOLLAR_SYMBOL_CODE, OPEN_BRACKET_CODE -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNodestatic ImmutableNodestatic ImmutableNodestatic ImmutableNodefromString(String string) booleanstatic ImmutableNodewithChildNode(boolean childNode) static ImmutableNodewithChildNode(double childNode) static ImmutableNodewithChildNode(long childNode) static ImmutableNodewithChildNode(INode<?> childNode) static ImmutableNodewithChildNodes(INode<?>... childNodes) static ImmutableNodewithChildNodes(Iterable<? extends INode<?>> childNodes) static ImmutableNodewithChildNodes(String... childNodes) static ImmutableNodewithHeader(boolean header) static ImmutableNodewithHeader(double header) static ImmutableNodewithHeader(long header) static ImmutableNodewithHeader(String header) static ImmutableNodewithHeaderAndChildNode(String header, boolean childNode) static ImmutableNodewithHeaderAndChildNode(String header, double childNode) static ImmutableNodewithHeaderAndChildNode(String header, long childNode) static ImmutableNodewithHeaderAndChildNode(String header, INode<?> childNode) static ImmutableNodewithHeaderAndChildNode(String header, String childNode) static ImmutableNodewithHeaderAndChildNodes(String header, INode<?>... childNodes) static ImmutableNodewithHeaderAndChildNodes(String header, Iterable<? extends INode<?>> childNodes) static ImmutableNodewithHeaderAndChildNodes(String header, String... childNodes) INode<?> withNewHeader(String header) Methods inherited from class AbstractNode
containsChildNodes, containsChildNodeThat, containsChildNodeWithHeader, containsOneChildNode, equals, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getEscapeStringFor, getOptionalStoredFirstChildNodeThat, getOriginStringFromEscapeString, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodesThat, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNodeThat, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, hashCode, isBlank, saveToFile, saveToFile, toBoolean, toDouble, toFormattedString, toInt, toString, toXmlMethods inherited from interface OptionalHeaderHolder
getHeaderOrEmptyString, getOptionalHeader, hasHeader
-
Field Details
-
EMPTY_NODE
-
-
Method Details
-
fromEnum
- Parameters:
paramEnum-- Returns:
- a new
ImmutableNodefrom the given paramEnum. throws RuntimeException if the given paramEnum is null.
-
fromFile
- Parameters:
filePath-- Returns:
- a new
ImmutableNodefrom the file with the given filePath. - Throws:
RuntimeException- if the given filePath is not valid.RuntimeException- if the file with the given filePath does not represent aImmutableNode.
-
fromNode
- Parameters:
node-- Returns:
- a new
ImmutableNodefrom the givenINode. - Throws:
RuntimeException- if the given node is null.
-
fromString
- Parameters:
string-- Returns:
- a new
ImmutableNodefrom the given string. - Throws:
RuntimeException- if the given string does not represent aImmutableNode.
-
withChildNode
- Parameters:
childNode-- Returns:
- a new
ImmutableNodewith the given childNode.
-
withChildNode
- Parameters:
childNode-- Returns:
- a new
ImmutableNodewith the given childNode.
-
withChildNode
- Parameters:
childNode-- Returns:
- a new
ImmutableNodewith the given childNode. - Throws:
RuntimeException- if the given childNode is null.
-
withChildNode
- Parameters:
childNode-- Returns:
- a new
ImmutableNodewith the given childNode.
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
ImmutableNodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes is null.
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
ImmutableNodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes is null.
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
ImmutableNodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes does not represent aImmutableNode.
-
withHeader
- Parameters:
header-- Returns:
- a new
ImmutableNodewith the given header.
-
withHeader
- Parameters:
header-- Returns:
- a new
ImmutableNodewith the given header.
-
withHeader
- Parameters:
header-- Returns:
- a new
ImmutableNodewith the given header.
-
withHeader
- Parameters:
header-- Returns:
- a new
ImmutableNodewith the given header. - Throws:
RuntimeException- if the given header is null or blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
ImmutableNodewith the given childNode. - Throws:
RuntimeException- if the given header is null or blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
ImmutableNodewith the given childNode. throws RuntimeException if the given header is null or blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
ImmutableNodewith the given header and childNode. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNode is null.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
ImmutableNodewith the given childNode. throws RuntimeException if the given header is null or blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
ImmutableNodewith the given header and childNode. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNode does not represent aImmutableNode.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
ImmutableNodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes is null.
-
withHeaderAndChildNodes
public static ImmutableNode withHeaderAndChildNodes(String header, Iterable<? extends INode<?>> childNodes) - Parameters:
header-childNodes-- Returns:
- a new
ImmutableNodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes is null.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
ImmutableNodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes does not represent aImmutableNode.
-
getHeader
- Returns:
- the header of the current
OptionalHeaderHolder
-
getStoredChildNodes
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
OptionalHeaderHolderhas a header, false otherwise
-
withNewHeader
-