Class ObjectToStringConverter

java.lang.Object
io.jmix.messagetemplatesflowui.ObjectToStringConverter

@Component("msgtmp_ObjectToStringConverter") public class ObjectToStringConverter extends Object
Helper class that converts objects to strings and vice versa. Mainly used to serialize default value for a MessageTemplateParameter.
  • Field Details

  • Constructor Details

  • Method Details

    • convertToString

      @Nullable public String convertToString(@Nullable Object object)
      Serialized the passed object to a string depending on its class type.
      Parameters:
      object - object to be serialized
      Returns:
      the serialized object, or null if the passed object is null
    • convertFromString

      @Nullable public <T> T convertFromString(Class<T> objectClass, @Nullable String objectString)
      Deserialized the passed string into an object of the specified objectClass type.
      Type Parameters:
      T - the type of object to deserialize
      Parameters:
      objectClass - JavaClass for the deserialization result object
      objectString - the string to deserialize
      Returns:
      the deserialized object of the required type
    • convertFromStringUnresolved

      protected <T> T convertFromStringUnresolved(Class<T> parameterClass, String objectString)