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 TypeMethodDescriptionINode<?> asWithHeader(String header) static 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, INode<?>... childNodes) static NodewithHeaderAndChildNode(String header, String childNode) static NodewithHeaderAndChildNodes(String header, Iterable<? extends INode<?>> childNodes) static NodewithHeaderAndChildNodes(String header, String... childNodes) 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
-
fromString
- Parameters:
string-- Returns:
- a new
Nodefrom the given string. - Throws:
RuntimeException- if the given string does not represent aNode.
-
withChildNode
-
withChildNode
-
withChildNode
-
withChildNodes
-
withChildNode
-
withChildNodes
-
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.
-
withHeader
-
withHeader
-
withHeader
-
withHeader
- Parameters:
header-- Returns:
- a new
Nodewith the given header. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given childNode. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given childNode. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
withHeaderAndChildNode
public static Node withHeaderAndChildNode(String header, INode<?> childNode, INode<?>... childNodes) - Parameters:
header-childNode-childNodes-- Returns:
- a new
Nodewith the given header and childNodes. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
withHeaderAndChildNode
- Parameters:
header-childNode-- Returns:
- a new
Nodewith the given childNode. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
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.
-
withHeaderAndChildNodes
- Parameters:
header-childNodes-- Returns:
- a new
Nodewith the given childNodes. - Throws:
RuntimeException- if the given header is null.RuntimeException- if the given header is blank.
-
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.
-
asWithHeader
-
getHeader
- Returns:
- the header of the current
IOptionalHeaderHolder.
-
getStoredChildNodes
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
IOptionalHeaderHolderhas a header, false otherwise.
-