Class EnumStringTranslator<T extends Enum<T>>

java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<T,String>
org.tentackle.fx.translate.EnumStringTranslator<T>
Type Parameters:
T - the enum type
All Implemented Interfaces:
ValueTranslator<T,String>

Abstract base class for enum translators.
Author:
harald
  • Constructor Details

    • EnumStringTranslator

      public EnumStringTranslator(FxTextComponent component, Class<T> clazz)
      Creates an enum translator.
      Parameters:
      component - the text component
      clazz - the enum class
  • Method Details

    • toViewFunction

      public Function<T,String> toViewFunction()
      Description copied from interface: ValueTranslator
      Function to translate a model value to a view value.
      Returns:
      the function
    • toModelFunction

      public Function<String,T> toModelFunction()
      Description copied from interface: ValueTranslator
      Function to translate a view value to a model value.
      Returns:
      the function