Package com.juliaaano.payload
Interface PayloadFactory
-
public interface PayloadFactory
A PayloadFactory creates new instances ofPayload
.An instance of Payload is linked to a corresponding
MediaType
, therefore implementations of this factory should be media type specific, such asXmlProviderFactory
.- Author:
- JM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Payload<T>
newInstance(String content, Class<T> type)
Creates a new instance ofPayload
out of a serialized, raw format.<T> Payload<T>
newInstance(T object)
Creates a new instance ofPayload
for a given object.
-
-
-
Method Detail
-
newInstance
<T> Payload<T> newInstance(String content, Class<T> type)
Creates a new instance ofPayload
out of a serialized, raw format.- Type Parameters:
T
- the object type that represents the new Payload- Parameters:
content
- the raw, serialized, Payload contenttype
- theClass
to explicitly define this Payload type- Returns:
- a new instance of Payload
-
-