Class EncodedValues

java.lang.Object
io.temporal.common.converter.EncodedValues
All Implemented Interfaces:
Values

public final class EncodedValues extends Object implements Values
  • Constructor Details

    • EncodedValues

      public EncodedValues(Optional<io.temporal.api.common.v1.Payloads> payloads, DataConverter converter)
    • EncodedValues

      public EncodedValues(Object... values)
  • Method Details

    • toPayloads

      public Optional<io.temporal.api.common.v1.Payloads> toPayloads()
    • setDataConverter

      public void setDataConverter(DataConverter converter)
    • getSize

      public int getSize()
      Specified by:
      getSize in interface Values
    • get

      public <T> T get(int index, Class<T> parameterType) throws DataConverterException
      Description copied from interface: Values
      Get value of the specified type.
      Specified by:
      get in interface Values
      Type Parameters:
      T - type of the value to get
      Parameters:
      index - index of the value in the list of values.
      parameterType - class of the value to get
      Returns:
      value or null
      Throws:
      DataConverterException - if value cannot be extracted to the given type
    • get

      public <T> T get(int index, Class<T> parameterType, Type genericParameterType) throws DataConverterException
      Description copied from interface: Values
      Get value of the specified generic type. For example if value is of type List use the following expression (using TypeToken) to extract:
      
       TypeToken<List<MyClass>> typeToken = new TypeToken<List<MyClass>>() {};
       List<MyClass> result = value.get(List.class, typeToken.getType());
        
      Specified by:
      get in interface Values
      Type Parameters:
      T - type of the value to get
      Parameters:
      index - index of the value in the list of values.
      parameterType - class of the value to get
      genericParameterType - the type of the value to get
      Returns:
      value or null
      Throws:
      DataConverterException - if value cannot be extracted to the given type