Class StdConverterBackwardsCompatAdapter
- java.lang.Object
-
- io.temporal.common.converter.StdConverterBackwardsCompatAdapter
-
public class StdConverterBackwardsCompatAdapter extends java.lang.Object
Temporal SDK should use Standard data converter for fields needed for internal essential functionality. See comments onDefaultDataConverter.STANDARD_INSTANCE
Unfortunately, bad code hygiene and overload of the word "default" with several meanings in DefaultDataConverter led to a situation where a user-defined converter may be used to serialize these internal fields instead. This problem is solved now and all SDK internal fields are serialized using Standard data converter. But users may already have workflows created by older SDKs and overridden "default" (in meaning "global") converter containing payloads in internal fields that must be deserialized using the user-defined converter.
This class provides a compatibility layer for deserialization of such internal fields by first using
DefaultDataConverter.STANDARD_INSTANCE
and falling back toGlobalDataConverter.get()
in case of an exception.
-
-
Constructor Summary
Constructors Constructor Description StdConverterBackwardsCompatAdapter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
fromPayload(io.temporal.api.common.v1.Payload payload, java.lang.Class<T> valueClass, java.lang.reflect.Type valueType)
static <T> T
fromPayloads(int index, java.util.Optional<io.temporal.api.common.v1.Payloads> content, java.lang.Class<T> valueType, java.lang.reflect.Type valueGenericType)
-
-
-
Method Detail
-
fromPayload
public static <T> T fromPayload(io.temporal.api.common.v1.Payload payload, java.lang.Class<T> valueClass, java.lang.reflect.Type valueType)
-
fromPayloads
public static <T> T fromPayloads(int index, java.util.Optional<io.temporal.api.common.v1.Payloads> content, java.lang.Class<T> valueType, java.lang.reflect.Type valueGenericType) throws DataConverterException
- Throws:
DataConverterException
-
-