Interface Stringifier<T>

Type Parameters:
T - the class of the objects to stringify
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DefaultStringifier

@Public @Stable public interface Stringifier<T> extends Closeable
Stringifier interface offers two methods to convert an object to a string representation and restore the object given its string representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this object.
    Restores the object from its string representation.
    toString(T obj)
    Converts the object to a string representation
  • Method Details

    • toString

      String toString(T obj) throws IOException
      Converts the object to a string representation
      Parameters:
      obj - the object to convert
      Returns:
      the string representation of the object
      Throws:
      IOException - if the object cannot be converted
    • fromString

      T fromString(String str) throws IOException
      Restores the object from its string representation.
      Parameters:
      str - the string representation of the object
      Returns:
      restored object
      Throws:
      IOException - if the object cannot be restored
    • close

      void close() throws IOException
      Closes this object.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - if an I/O error occurs