Class ImmutableNode
- All Implemented Interfaces:
OptionalHeaderHolder, FormattedStringRepresentable, Node<ImmutableNode>, BlanknessRequestable
- Author:
- Silvan Wyss
-
Field Summary
FieldsFields inherited from interface FormattedStringRepresentable
DEFAULT_IDENTATION_LEVEL, DEFAULT_IDENTTATION_SYMBOL, DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG -
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(Node<?> childNode) static ImmutableNodewithChildNodes(Node<?>... childNodes) static ImmutableNodewithChildNodes(Iterable<? extends Node<?>> 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, Node<?> childNode) static ImmutableNodewithHeaderAndChildNode(String header, String childNode) static ImmutableNodewithHeaderAndChildNodes(String header, Node<?>... childNodes) static ImmutableNodewithHeaderAndChildNodes(String header, Iterable<? extends Node<?>> childNodes) static ImmutableNodewithHeaderAndChildNodes(String header, String... childNodes) Node<?> withNewHeader(String header) Methods inherited from class AbstractNode
containsChildNode, containsChildNodes, containsChildNodeWithHeader, equals, formattedStringWillHaveMultipleLines, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getEscapeStringFor, getOptionalStoredFirstChildNode, getOriginStringFromEscapeString, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodes, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNode, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, hashCode, isBlank, saveToFile, saveToFile, toBoolean, toDouble, toFormattedStringWithIndentationLevelAndIndentationSymbol, toInt, toString, toXmlMethods inherited from interface FormattedStringRepresentable
toFormattedString, toFormattedStringWithIndentationLevel, toFormattedStringWithIndentationLevelAndIndentationSymbolMethods 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 validRuntimeException- if the file with the given filePath does not represent aImmutableNode.
-
fromNode
- Parameters:
node-- Returns:
- a new
ImmutableNodefrom the givenNode - 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 blankRuntimeException- 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 blankRuntimeException- 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 blankRuntimeException- if the given childNodes is nullRuntimeException- if one of the given childNodes is null
-
withHeaderAndChildNodes
public static ImmutableNode withHeaderAndChildNodes(String header, Iterable<? extends Node<?>> childNodes) - Parameters:
header-childNodes-- Returns:
- a new
ImmutableNodewith the given header and childNodes - Throws:
RuntimeException- if the given header is null or blankRuntimeException- 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 blankRuntimeException- 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
-