public interface PayloadConverter
Modifier and Type | Method and Description |
---|---|
<T> T |
fromData(io.temporal.api.common.v1.Payload content,
java.lang.Class<T> valueClass,
java.lang.reflect.Type valueType)
Implements conversion of a single value.
|
java.lang.String |
getEncodingType()
Each
PayloadConverter has an Encoding Type that it handles. |
java.util.Optional<io.temporal.api.common.v1.Payload> |
toData(java.lang.Object value)
Implements conversion of a list of values.
|
java.lang.String getEncodingType()
PayloadConverter
has an Encoding Type that it handles. Each PayloadConverter
should add the information about its Encoding Type into the Payload
it produces inside toData(Object)
by associating it with the EncodingKeys.METADATA_ENCODING_KEY
key attached to the Payload
's Metadata using Payload.Builder#putMetadata(String, ByteString)
.java.util.Optional<io.temporal.api.common.v1.Payload> toData(java.lang.Object value) throws DataConverterException
value
- Java value to convert.DataConverterException
- if conversion of the value passed as parameter failed for any
reason.getEncodingType javadoc for an important implementation detail
<T> T fromData(io.temporal.api.common.v1.Payload content, java.lang.Class<T> valueClass, java.lang.reflect.Type valueType) throws DataConverterException
content
- Serialized value to convert to a Java object.valueClass
- valueType
- DataConverterException
- if conversion of the data passed as parameter failed for any
reason.