Klasse FileNode

Alle implementierten Schnittstellen:
IFluentMutableOptionalHeaderHolder<FileNode>, IOptionalHeaderHolder, IMutableNode<FileNode>, INode<FileNode>, Resettable, BlanknessRequestable

public final class FileNode extends AbstractMutableNode<FileNode>
A FileNode is a specification that is stored in a file.
Autor:
Silvan Wyss
  • Konstruktordetails

    • FileNode

      public FileNode(String filePath)
      Creates a new FileNode with the given file path. Creates a new file if there does not exist a file with the given file path. Access and changes the file if there exists a file with the given file path.
      Parameter:
      filePath -
  • Methodendetails

    • addChildNode

      public FileNode addChildNode(INode<?> childNode, INode<?>... childNodes)
      Adds the given childNodes to the current IMutableNode.
      Parameter:
      childNode -
      childNodes -
      Gibt zurück:
      the current IMutableNode.
    • addChildNodeFromString

      public FileNode addChildNodeFromString(String string, String... strings)
      Adds the child INodes from the given strings the current IMutableNode.
      Parameter:
      string -
      strings -
      Gibt zurück:
      the current IMutableNode.
    • addChildNodes

      public <N extends INode<?>> FileNode addChildNodes(Iterable<N> childNodes)
      Adds the given childNodes to the current IMutableNode.
      Typparameter:
      N - is the type of the given childNodes.
      Parameter:
      childNodes -
      Gibt zurück:
      the current IMutableNode.
    • addChildNodesFromStrings

      public FileNode addChildNodesFromStrings(Iterable<String> strings)
      Adds the child INodes from the given strings the current IMutableNode.
      Parameter:
      strings -
      Gibt zurück:
      the current IMutableNode.
    • asWithHeader

      public INode<?> asWithHeader(String header)
      Parameter:
      header -
      Gibt zurück:
      a new INode that is a copy of the current INode with the given header.
    • getHeader

      public String getHeader()
      Gibt zurück:
      the header of the current IOptionalHeaderHolder.
    • getStoredChildNodes

      public ContainerView<FileNode> getStoredChildNodes()
      Gibt zurück:
      the child INodes of the current INode.
    • hasHeader

      public boolean hasHeader()
      Gibt zurück:
      true if the current IOptionalHeaderHolder has a header, false otherwise.
    • removeAndGetStoredFirstChildNodeThat

      public FileNode removeAndGetStoredFirstChildNodeThat(Predicate<INode<?>> selector)
      Removes and returns the first child INode the given selector selects from the current IMutableNode.
      Parameter:
      selector -
      Gibt zurück:
      the first child INode the given selector selects from the current IMutableNode.
    • removeFirstChildNodeThat

      public void removeFirstChildNodeThat(Predicate<INode<?>> selector)
      Removes the first child INode the given selector selects from the current IMutableNode.
      Parameter:
      selector -
    • removeFirstChildNodeWithHeader

      public void removeFirstChildNodeWithHeader(String header)
      Removes the first child INode with the given header from the current IMutableNode.
      Parameter:
      header -
    • removeChildNodes

      public void removeChildNodes()
      Removes the child INodes from the current IMutableNode.
    • removeHeader

      public void removeHeader()
      Removes the header of current IFluentMutableOptionalHeaderHolder.
    • replaceFirstChildNodeWithGivenHeaderByGivenNode

      public void replaceFirstChildNodeWithGivenHeaderByGivenNode(String header, INode<?> node)
      Replaces the first child INode with the given header from the current IMutableNode by the given INode.
      Parameter:
      header -
      node -
    • reset

      public void reset()
      Resets the current Resettable.
    • setHeader

      public FileNode setHeader(String header)
      Sets the header of the current IFluentMutableOptionalHeaderHolder.
      Parameter:
      header -
      Gibt zurück:
      the current IFluentMutableOptionalHeaderHolder.