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
-
Method Details
-
asStream
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
Covert T into a unique string representation. This value is saved to the XML produced byChecksummer.write(org.dom4j.Element)
. It should provide enough information to be able to restore T later in theasObject(String)
method.- Parameters:
object
- the object to convert.- Returns:
- a string representation of T.
-
asObject
The passed String back into T. The parameter was created from a previous call toasString(Object)
}.- Parameters:
string
- the string to convert.- Returns:
- T after being converted from the passed String.
-