Class FileNode
- All Implemented Interfaces:
IFluentMutableOptionalHeaderHolder<FileNode>, IOptionalHeaderHolder, IMutableNode<FileNode>, INode<FileNode>, Resettable, BlanknessRequestable
A
FileNode is a specification that is stored in a file.- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from class AbstractNode
CLOSED_BRACKET_CODE, COMMA_CODE, DOLLAR_SYMBOL_CODE, OPEN_BRACKET_CODE -
Method Summary
Modifier and TypeMethodDescriptionaddChildNode(INode<?> childNode) Adds the given childNode to the currentIMutableNode.addChildNodes(INode<?>... 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 childINodes from the given strings the currentIMutableNode.addChildNodesFromStrings(String... strings) Adds the childINodes from the given strings to the currentIMutableNode.INode<?> asWithHeader(String header) booleanremoveAndGetStoredFirstChildNodeThat(Predicate<INode<?>> selector) Removes and returns the first childINodethe given selector selects from the currentIMutableNode.voidRemoves the childINodes from the currentIMutableNode.voidremoveFirstChildNodeThat(Predicate<INode<?>> selector) Removes the first childINodethe given selector selects from the currentIMutableNode.voidremoveFirstChildNodeWithHeader(String header) Removes the first childINodewith the given header from the currentIMutableNode.voidRemoves the header of currentIFluentMutableOptionalHeaderHolder.voidreplaceFirstChildNodeWithGivenHeaderByGivenNode(String header, INode<?> node) Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.voidreset()Resets the currentResettable.Sets the header of the currentIFluentMutableOptionalHeaderHolder.static FileNodewithFilePath(String filePath) Methods inherited from class AbstractMutableNode
addPostfixToHeader, addPrefixToHeader, resetFromFile, resetFromNode, resetFromString, setChildNodesMethods 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 BlanknessRequestable
isBlankMethods inherited from interface INode
containsChildNodes, containsChildNodeThat, containsChildNodeWithHeader, containsOneChildNode, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getOptionalStoredFirstChildNodeThat, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodesThat, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNodeThat, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, toBoolean, toDouble, toFormattedString, toInt, toXmlMethods inherited from interface IOptionalHeaderHolder
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- is the type of the given childNodes.- Parameters:
childNodes-- Returns:
- the current
IMutableNode.
-
addChildNodesFromStrings
Adds the childINodes from the given strings the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode.
-
addChildNodesFromStrings
Adds the childINodes from the given strings to the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode.
-
asWithHeader
-
getHeader
- Returns:
- the header of the current
IOptionalHeaderHolder.
-
getStoredChildNodes
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
IOptionalHeaderHolderhas a header, false otherwise.
-
removeAndGetStoredFirstChildNodeThat
Removes and returns the first childINodethe given selector selects from the currentIMutableNode.- Parameters:
selector-- Returns:
- the first child
INodethe given selector selects from the currentIMutableNode.
-
removeFirstChildNodeThat
Removes the first childINodethe given selector selects from the currentIMutableNode.- Parameters:
selector-
-
removeFirstChildNodeWithHeader
Removes the first childINodewith the given header from the currentIMutableNode.- Parameters:
header-
-
removeChildNodes
public void removeChildNodes()Removes the childINodes from the currentIMutableNode. -
removeHeader
public void removeHeader()Removes the header of currentIFluentMutableOptionalHeaderHolder. -
replaceFirstChildNodeWithGivenHeaderByGivenNode
Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.- Parameters:
header-node-
-
reset
public void reset()Resets the currentResettable. -
setHeader
Sets the header of the currentIFluentMutableOptionalHeaderHolder.- Parameters:
header-- Returns:
- the current
IFluentMutableOptionalHeaderHolder.
-