Interface MediaTypeMarshaller
public interface MediaTypeMarshaller
A marshaller that takes the
MediaType
decision to marshall/unmarshall.- Since:
- 15.0
-
Method Summary
Modifier and TypeMethodDescription<T> T
bytesToKey
(byte[] bytes, ClassAllowList allowList) Unmarshall the byte array into the object form.<T> T
bytesToValue
(byte[] bytes, ClassAllowList allowList) Unmarshall the byte array into the object form.The decided type for the key.The decided type for the values.byte[]
keyToBytes
(Object key) Transforms the key object to the marshalled form.byte[]
valueToBytes
(Object value) Transforms the value object to the marshalled form.
-
Method Details
-
getKeyType
MediaType getKeyType()The decided type for the key.- Returns:
- The media type the marshaller uses for keys.
-
getValueType
MediaType getValueType()The decided type for the values.- Returns:
- The media type the marshaller uses for values.
-
keyToBytes
Transforms the key object to the marshalled form. The marshalled format respects the define media type for the key.- Parameters:
key
- : Key object to marshall.- Returns:
- The byte array representation of the object in the decided key media type.
-
valueToBytes
Transforms the value object to the marshalled form. The marshalled format respects the define media type for the value.- Parameters:
value
- : Value object to marshall.- Returns:
- The byte array representation of the object in the decided value media type.
-
bytesToKey
Unmarshall the byte array into the object form. The unmarshalling follows the process by the decided key media type.- Parameters:
bytes
- : Byte array to unmarshall.allowList
- : The allowed list of classes to use during unmarshalling.- Returns:
- The object store in the byte array representation.
-
bytesToValue
Unmarshall the byte array into the object form. The unmarshalling follows the process by the decided value media type.- Parameters:
bytes
- : Byte array to unmarshall.allowList
- : The allowed list of classes to use during unmarshalling.- Returns:
- The object store in the byte array representation.
-