T - the type that can be converted@PublicSpi
public interface Marshaller<T>
bytes.
Notes:
unmarshall(byte[]) method should only ever be passed data that was generated by
calling the marshall(Object) method on an instance of Marshaller associated
with a cache with the same name. However, the
unmarshall(byte[]) should endeavour to be robust in the event of arbitrary data.
unmarshall(byte[]) for the same input byte array must match when
compared using the Object.equals(Object) method.
ExternalCache documentation.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
marshall(T obj)
Responsible for converting a object into an array of bytes.
|
T |
unmarshall(byte[] raw)
Responsible for converting an array of bytes into an object.
|
@Nonnull byte[] marshall(T obj) throws MarshallerException
obj - the object to be converted.MarshallerException - if unable to perform the conversion@Nonnull T unmarshall(byte[] raw) throws MarshallerException
Object.equals(Object) method.raw - the array of bytes to be converted.MarshallerException - if unable to perform the conversionCopyright © 2015 Atlassian. All rights reserved.