DataConverter Interface
public interface DataConverter
Interface 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.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| abstract T |
deserialize(String data, Class<T> target)
Deserializes the given text data into an object of the specified type. |
| static java.time.Instant | getInstantFromTimestamp(Timestamp ts) |
| static com.google.protobuf.Timestamp | getTimestampFromInstant(Instant instant) |
| abstract java.lang.String |
serialize(Object value)
Serializes the input into a text representation. |
Method Details
deserialize
public abstract T
Deserializes the given text data into an object of the specified type.
Parameters:
Returns:
TgetInstantFromTimestamp
public static Instant getInstantFromTimestamp(Timestamp ts)
Parameters:
getTimestampFromInstant
public static Timestamp getTimestampFromInstant(Instant instant)
Parameters:
serialize
public abstract String serialize(Object value)
Serializes the input into a text representation.
Parameters:
Returns:
null if the value is null