Package org.apache.hadoop.io
Interface Stringifier<T>
- Type Parameters:
T- the class of the objects to stringify
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DefaultStringifier
Stringifier interface offers two methods to convert an object
to a string representation and restore the object given its
string representation.
-
Method Summary
-
Method Details
-
toString
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
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
Closes this object.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs
-