Class ValueTypeToStringConverter

java.lang.Object
org.openhab.core.model.core.valueconverter.ValueTypeToStringConverter
All Implemented Interfaces:
org.eclipse.xtext.conversion.IValueConverter<@Nullable Object>

@NonNullByDefault public class ValueTypeToStringConverter extends Object implements org.eclipse.xtext.conversion.IValueConverter<@Nullable Object>
A ValueTypeToStringConverter is used to create a String, Boolean, or BigDecimal from an input string and vice versa.
Author:
Alex Tugarev - Initial contribution
  • Constructor Details

    • ValueTypeToStringConverter

      public ValueTypeToStringConverter()
  • Method Details

    • toValue

      public @Nullable Object toValue(@Nullable String string, @Nullable org.eclipse.xtext.nodemodel.INode node) throws org.eclipse.xtext.conversion.ValueConverterException
      Specified by:
      toValue in interface org.eclipse.xtext.conversion.IValueConverter<@Nullable Object>
      Throws:
      org.eclipse.xtext.conversion.ValueConverterException
    • toString

      public String toString(@Nullable Object value) throws org.eclipse.xtext.conversion.ValueConverterException
      Specified by:
      toString in interface org.eclipse.xtext.conversion.IValueConverter<@Nullable Object>
      Throws:
      org.eclipse.xtext.conversion.ValueConverterException
    • toEscapedString

      protected String toEscapedString(String value)