Package com.juliaaano.payload.provider
Interface Provider
-
public interface Provider
A Provider is an abstraction of the underlying mechanism that serializes and deserializes data.It should be extended by clients of the library who wish to support additional (custom) providers.
- Author:
- Juliano Mohr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
deserialize(String raw, Class<T> type)
deserializes the specified media type representation into an object of the specified class.String
serialize(Object object)
Serializes the specified object into its equivalent media type representation.
-
-
-
Method Detail
-
serialize
String serialize(Object object)
Serializes the specified object into its equivalent media type representation.- Parameters:
object
- the object for which a representation is to be created- Returns:
- representation of object
-
deserialize
<T> T deserialize(String raw, Class<T> type)
deserializes the specified media type representation into an object of the specified class.- Type Parameters:
T
- the type of the desired object- Parameters:
raw
- the string from which the object is to be deserializedtype
- the class of T- Returns:
- an object of type T from the string
-
-