Class FileNode
- All Implemented Interfaces:
FluentMutableOptionalHeaderHolder<FileNode>, OptionalHeaderHolder, FormattedStringRepresentable, IMutableNode<FileNode>, Node<FileNode>, Resettable, BlanknessRequestable
A
FileNode is a specification that is stored in a file.- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from interface FormattedStringRepresentable
DEFAULT_IDENTATION_LEVEL, DEFAULT_IDENTTATION_SYMBOL, DEFAULT_START_MULTILINER_WITH_IDENTATION_FLAG -
Method Summary
Modifier and TypeMethodDescriptionaddChildNode(Node<?> childNode) Adds the given childNode to the currentIMutableNode.addChildNodes(Node<?>... childNodes) Adds the given childNodes to the currentIMutableNode.addChildNodes(Iterable<N> childNodes) Adds the given childNodes to the currentIMutableNode.addChildNodesFromStrings(Iterable<String> strings) Adds the childNodes from the given strings the currentIMutableNode.addChildNodesFromStrings(String... strings) Adds the childNodes from the given strings to the currentIMutableNode.booleanremoveAndGetStoredFirstChildNodeThat(Predicate<Node<?>> selector) Removes and returns the first childNodethe given selector selects from the currentIMutableNode.voidRemoves the childNodes from the currentIMutableNode.voidremoveFirstChildNodeThat(Predicate<Node<?>> selector) Removes the first childNodethe given selector selects from the currentIMutableNode.voidremoveFirstChildNodeWithHeader(String header) Removes the first childNodewith the given header from the currentIMutableNode.voidRemoves the header of currentFluentMutableOptionalHeaderHolder.voidreplaceFirstChildNodeWithGivenHeaderByGivenNode(String header, Node<?> node) Replaces the first childNodewith the given header from the currentIMutableNodeby the givenNode.voidreset()Resets the currentResettable.Sets the header of the currentFluentMutableOptionalHeaderHolder.static FileNodewithFilePath(String filePath) Node<?> withNewHeader(String header) Methods inherited from class AbstractMutableNode
addPostfixToHeader, addPrefixToHeader, resetFromFile, resetFromNode, resetFromString, setChildNodesMethods 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 BlanknessRequestable
isBlankMethods inherited from interface FormattedStringRepresentable
formattedStringWillHaveMultipleLines, toFormattedString, toFormattedStringWithIndentationLevel, toFormattedStringWithIndentationLevelAndIndentationSymbol, toFormattedStringWithIndentationLevelAndIndentationSymbolMethods inherited from interface Node
containsChildNode, containsChildNodes, containsChildNodeWithHeader, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getOptionalStoredFirstChildNode, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodes, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNode, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, toBoolean, toDouble, toInt, toXmlMethods inherited from interface OptionalHeaderHolder
getHeaderOrEmptyString, getOptionalHeader, hasHeader
-
Method Details
-
withFilePath
-
addChildNode
Adds the given childNode to the currentIMutableNode.- Parameters:
childNode-- Returns:
- the current
IMutableNode
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Parameters:
childNodes-- Returns:
- the current
IMutableNode
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Type Parameters:
N- the type of the given childNodes- Parameters:
childNodes-- Returns:
- the current
IMutableNode
-
addChildNodesFromStrings
Adds the childNodes from the given strings the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode
-
addChildNodesFromStrings
Adds the childNodes from the given strings to the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode
-
withNewHeader
-
getHeader
- Returns:
- the header of the current
OptionalHeaderHolder
-
getStoredChildNodes
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
OptionalHeaderHolderhas a header, false otherwise
-
removeAndGetStoredFirstChildNodeThat
Removes and returns the first childNodethe given selector selects from the currentIMutableNode.- Parameters:
selector-- Returns:
- the first child
Nodethe given selector selects from the currentIMutableNode
-
removeFirstChildNodeThat
Removes the first childNodethe given selector selects from the currentIMutableNode.- Parameters:
selector-
-
removeFirstChildNodeWithHeader
Removes the first childNodewith the given header from the currentIMutableNode.- Parameters:
header-
-
removeChildNodes
public void removeChildNodes()Removes the childNodes from the currentIMutableNode. -
removeHeader
public void removeHeader()Removes the header of currentFluentMutableOptionalHeaderHolder. -
replaceFirstChildNodeWithGivenHeaderByGivenNode
Replaces the first childNodewith the given header from the currentIMutableNodeby the givenNode.- Parameters:
header-node-
-
reset
public void reset()Resets the currentResettable. -
setHeader
Sets the header of the currentFluentMutableOptionalHeaderHolder.- Parameters:
header-- Returns:
- the current
FluentMutableOptionalHeaderHolder
-