Class StdConverterBackwardsCompatAdapter

java.lang.Object
io.temporal.common.converter.StdConverterBackwardsCompatAdapter

public class StdConverterBackwardsCompatAdapter extends Object
Temporal SDK should use Standard data converter for fields needed for internal essential functionality. See comments on DefaultDataConverter.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 to GlobalDataConverter.get() in case of an exception.

  • Constructor Details

    • StdConverterBackwardsCompatAdapter

      public StdConverterBackwardsCompatAdapter()
  • Method Details

    • fromPayload

      public static <T> T fromPayload(io.temporal.api.common.v1.Payload payload, Class<T> valueClass, Type valueType)
    • fromPayloads

      public static <T> T fromPayloads(int index, Optional<io.temporal.api.common.v1.Payloads> content, Class<T> valueType, Type valueGenericType) throws DataConverterException
      Throws:
      DataConverterException