Interface ReadableRoot

All Superinterfaces:
DataRoot
All Known Implementing Classes:
InputOutputRoot, PathRoot, StringRoot

public interface ReadableRoot extends DataRoot
Unifying interface for string based data roots.
  • Method Details

    • readString

      @NonNull String readString() throws IOException
      Reads to a string
      Returns:
      the read content
      Throws:
      IOException - upon failure to open
    • openReader

      <R> R openReader(@NonNull DataRoot.Operation<R,@NonNull Reader> operation) throws IOException
      Opens a reader to the data
      Type Parameters:
      R - the result type
      Parameters:
      operation - the operation
      Returns:
      the operation result
      Throws:
      IOException - upon failure to open
    • writeString

      void writeString(@NonNull String content) throws IOException
      Writes to a string
      Parameters:
      content - the content to write
      Throws:
      IOException - upon failure to write
    • openWriter

      <R> R openWriter(@NonNull DataRoot.Operation<R,@NonNull Writer> operation) throws IOException
      Opens a writer for the data
      Type Parameters:
      R - the result type
      Parameters:
      operation - the operation
      Returns:
      the operation result
      Throws:
      IOException - upon failure to open