Interface Checksummer.Helper<T>

Type Parameters:
T -
Enclosing class:
Checksummer<T>

public static interface Checksummer.Helper<T>
Helps with the conversion of T into and from its different forms needed for the operation of the checksummer.

Objects that are to be hashed must be converted into InputStream

  • Method Summary

    Modifier and Type
    Method
    Description
    asObject(String string)
    The passed String back into T.
    asStream(T object)
    Convert T into a stream of raw bytes so that it can be hashed.
    asString(T object)
    Covert T into a unique string representation.
  • Method Details

    • asStream

      InputStream asStream(T object)
      Convert T into a stream of raw bytes so that it can be hashed.
      Parameters:
      object - the object to convert.
      Returns:
      the stream that represents T.
    • asString

      String asString(T object)
      Covert T into a unique string representation. This value is saved to the XML produced by Checksummer.write(org.dom4j.Element). It should provide enough information to be able to restore T later in the asObject(String) method.
      Parameters:
      object - the object to convert.
      Returns:
      a string representation of T.
    • asObject

      T asObject(String string)
      The passed String back into T. The parameter was created from a previous call to asString(Object)}.
      Parameters:
      string - the string to convert.
      Returns:
      T after being converted from the passed String.