Package com.microsoft.durabletask
Interface DataConverter
-
- All Known Implementing Classes:
JacksonDataConverter
public interface DataConverterInterface for serializing and deserializing data that gets passed to and from orchestrators and activities.Implementations of this abstract class are free to use any serialization method. Currently, only strings are supported as the serialized representation of data. Byte array payloads and streams are not supported by this abstraction. Note that these methods all accept null values, in which case the return value should also be null.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDataConverter.DataConverterException
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tdeserialize(java.lang.String data, java.lang.Class<T> target)Deserializes the given text data into an object of the specified type.static java.time.InstantgetInstantFromTimestamp(com.google.protobuf.Timestamp ts)static com.google.protobuf.TimestampgetTimestampFromInstant(java.time.Instant instant)java.lang.Stringserialize(java.lang.Object value)Serializes the input into a text representation.
-
-
-
Method Detail
-
serialize
@Nullable java.lang.String serialize(@Nullable java.lang.Object value)Serializes the input into a text representation.- Parameters:
value- the value to be serialized- Returns:
- a serialized text representation of the value or
nullif the value isnull
-
deserialize
@Nullable <T> T deserialize(@Nullable java.lang.String data, java.lang.Class<T> target)Deserializes the given text data into an object of the specified type.- Type Parameters:
T- the generic parameter type representing the target class to deserialize the input into- Parameters:
data- the text data to deserialize into an objecttarget- the target class to deserialize the input into- Returns:
- a deserialized object of type
T - Throws:
DataConverter.DataConverterException- if the text data cannot be deserialized
-
getInstantFromTimestamp
static java.time.Instant getInstantFromTimestamp(com.google.protobuf.Timestamp ts)
-
getTimestampFromInstant
static com.google.protobuf.Timestamp getTimestampFromInstant(java.time.Instant instant)
-
-