Interface IMutableNode<N extends IMutableNode<N>>
- Type Parameters:
N- is the type of aIMutableNode.
- All Superinterfaces:
BlanknessRequestable, IFluentMutableOptionalHeaderHolder<N>, INode<N>, IOptionalHeaderHolder, Resettable
- All Known Implementing Classes:
AbstractMutableNode, FileNode, MutableNode
public interface IMutableNode<N extends IMutableNode<N>>
extends INode<N>, IFluentMutableOptionalHeaderHolder<N>, Resettable
A
IMutableNode is a INode that is mutable.- Author:
- Silvan Wyss
-
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<N2> 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.addPostfixToHeader(String postfix) Adds the given postfix at the end of the header of the currentIMutableNodeif the currentIMutableNodehas a header.addPrefixToHeader(String prefix) Adds the given prefix at the begin of the header of the currentIMutableNodeif the currentIMutableNodehas a header.removeAndGetStoredFirstChildNodeThat(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.voidreplaceFirstChildNodeWithGivenHeaderByGivenNode(String header, INode<?> node) Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.voidresetFromFile(String filePath) Resets the currentIMutableNodefrom the file with the given file path.voidresetFromNode(INode<?> node) Resets the currentIMutableNodefrom the given node.voidresetFromString(String string) Resets the currentIMutableNodefrom the given string.setChildNodes(Iterable<? extends INode<?>> childNodes) Resets the childINodes of the currentIMutableNodewith the given childNodes.Methods inherited from interface BlanknessRequestable
isBlankMethods inherited from interface IFluentMutableOptionalHeaderHolder
removeHeader, setHeaderMethods inherited from interface INode
asWithHeader, containsChildNodes, containsChildNodeThat, containsChildNodeWithHeader, containsOneChildNode, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getOptionalStoredFirstChildNodeThat, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodes, getStoredChildNodesThat, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNodeThat, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, toBoolean, toDouble, toFormattedString, toInt, toXmlMethods inherited from interface IOptionalHeaderHolder
getHeader, getHeaderOrEmptyString, getOptionalHeader, hasHeader, hasHeaderMethods inherited from interface Resettable
reset
-
Method Details
-
addChildNode
Adds the given childNode to the currentIMutableNode.- Parameters:
childNode-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if the given childNodes is null.
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Parameters:
childNodes-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if one of the given childNodes is null.
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Type Parameters:
N2- is the type of the given childNodes.- Parameters:
childNodes-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if one of the given childNodes is null.
-
addChildNodesFromStrings
Adds the childINodes from the given strings the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if one of the given strings does not represent aINode.
-
addChildNodesFromStrings
Adds the childINodes from the given strings to the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if the given strings is null.RuntimeException- if one of the given strings does not represent aINode.
-
addPostfixToHeader
Adds the given postfix at the end of the header of the currentIMutableNodeif the currentIMutableNodehas a header. Sets the given postfix as the header of the currentIMutableNodeif the currentIMutableNodedoes not have a header.- Parameters:
postfix-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if the given postfix is null.RuntimeException- if the given postfix is blank.
-
addPrefixToHeader
Adds the given prefix at the begin of the header of the currentIMutableNodeif the currentIMutableNodehas a header. Sets the given prefix as the header of the currentIMutableNodeif the currentIMutableNodedoes not have a header.- Parameters:
prefix-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if the given prefix is null.RuntimeException- if the given prefix is blank.
-
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. - Throws:
RuntimeException- if the currentIMutableNodedoes not contain a childINodethe given selector selects.
-
removeChildNodes
void removeChildNodes()Removes the childINodes from the currentIMutableNode. -
removeFirstChildNodeThat
Removes the first childINodethe given selector selects from the currentIMutableNode.- Parameters:
selector-- Throws:
RuntimeException- if the currentIMutableNodedoes not contain a childINodethe given selector selects.
-
removeFirstChildNodeWithHeader
Removes the first childINodewith the given header from the currentIMutableNode.- Parameters:
header-- Throws:
RuntimeException- if the currentIMutableNodedoes not contain a childINodewith the given header.
-
replaceFirstChildNodeWithGivenHeaderByGivenNode
Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.- Parameters:
header-node-- Throws:
RuntimeException- if the currentIMutableNodedoes not contain a childINodewith the given header.
-
resetFromFile
Resets the currentIMutableNodefrom the file with the given file path.- Parameters:
filePath-
-
resetFromNode
Resets the currentIMutableNodefrom the given node.- Parameters:
node-- Throws:
RuntimeException- if the given node is null.
-
resetFromString
Resets the currentIMutableNodefrom the given string.- Parameters:
string-- Throws:
RuntimeException- if the given string does not represent aIMutableNode.
-
setChildNodes
Resets the childINodes of the currentIMutableNodewith the given childNodes.- Parameters:
childNodes-- Returns:
- the current
IMutableNode. - Throws:
RuntimeException- if one of the given childNodes is null.
-