Class Node
- All Implemented Interfaces:
IOptionalHeaderHolder, INode<Node>, BlanknessRequestable
-
Field Summary
FieldsFields inherited from class AbstractNode
CLOSED_BRACKET_CODE, COMMA_CODE, DOLLAR_SYMBOL_CODE, OPEN_BRACKET_CODE -
Method Summary
Modifier and TypeMethodDescriptionstatic Nodestatic Nodestatic Nodestatic NodefromString(String string) booleanstatic NodewithChildNode(boolean childNode) static NodewithChildNode(double childNode) static NodewithChildNode(long childNode) static NodewithChildNode(INode<?> childNode) static NodewithChildNodes(INode<?>... childNodes) static NodewithChildNodes(Iterable<? extends INode<?>> childNodes) static NodewithChildNodes(String... childNodes) static NodewithHeader(boolean header) static NodewithHeader(double header) static NodewithHeader(long header) static NodewithHeader(String header) static NodewithHeaderAndChildNode(String header, boolean childNode) static NodewithHeaderAndChildNode(String header, double childNode) static NodewithHeaderAndChildNode(String header, long childNode) static NodewithHeaderAndChildNode(String header, INode<?> childNode) static NodewithHeaderAndChildNode(String header, String childNode) static NodewithHeaderAndChildNodes(String header, INode<?>... childNodes) static NodewithHeaderAndChildNodes(String header, Iterable<? extends INode<?>> childNodes) static NodewithHeaderAndChildNodes(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 IOptionalHeaderHolder
getHeaderOrEmptyString, getOptionalHeader, hasHeader
-
Field Details
-
EMPTY_NODE
-
-
Method Details
-
fromEnum
-
fromFile
- Parameters:
filePath-- Returns:
- a new
Nodefrom 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 aNode.
-
fromNode
- Parameters:
node-- Returns:
- a new
Nodefrom the givenINode. - Throws:
RuntimeException- if the given node is null.
-
fromString
- Parameters:
string-- Returns:
- a new
Nodefrom the given string. - Throws:
RuntimeException- if the given string does not represent aNode.
-
withChildNode
-
withChildNode
-
withChildNode
- Parameters:
childNode-- Returns:
- a new
Nodewith the given childNode. - Throws:
RuntimeException- if the given childNode is null.
-
withChildNode
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
Nodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes is null.
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
Nodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes is null.
-
withChildNodes
- Parameters:
childNodes-- Returns:
- a new
Nodewith the given childNodes. - Throws:
RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes does not represent aNode.
-
withHeader
-
withHeader
-
withHeader
-
withHeader
- Parameters:
header-- Returns:
- a new
Nodewith the given header. - Throws:
RuntimeException- if the given header is null or blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given childNode. - Throws:
RuntimeException- if the given header is null or blank.
-
withHeaderAndChildNode
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given header and childNode. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNode is null.
-
withHeaderAndChildNode
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given header and childNode. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNode does not represent aNode.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
Nodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes is null.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
Nodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes is null.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
Nodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null or blank.RuntimeException- if the given childNodes is null.RuntimeException- if one of the given childNodes does not represent aNode.
-
getHeader
- Returns:
- the header of the current
IOptionalHeaderHolder.
-
getStoredChildNodes
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
IOptionalHeaderHolderhas a header, false otherwise.
-
withNewHeader
-