Module org.tentackle.fx
Package org.tentackle.fx.translate
Class EnumStringTranslator<T extends java.lang.Enum<T>>
- java.lang.Object
-
- org.tentackle.fx.translate.AbstractValueTranslator<T,java.lang.String>
-
- org.tentackle.fx.translate.EnumStringTranslator<T>
-
- Type Parameters:
T- the enum type
- All Implemented Interfaces:
ValueTranslator<T,java.lang.String>
@ValueTranslatorService(modelClass=java.lang.Enum.class, viewClass=java.lang.String.class) public class EnumStringTranslator<T extends java.lang.Enum<T>> extends AbstractValueTranslator<T,java.lang.String>
Abstract base class for enum translators.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description EnumStringTranslator(FxTextComponent component, java.lang.Class<T> clazz)Creates an enum translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Function<java.lang.String,T>toModelFunction()Function to translate a view value to a model value.java.util.function.Function<T,java.lang.String>toViewFunction()Function to translate a model value to a view value.-
Methods inherited from class org.tentackle.fx.translate.AbstractValueTranslator
getComponent, isLenient, setLenient
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tentackle.fx.ValueTranslator
bindingPropertiesUpdated, needsToModelTwice, toModel, toView
-
-
-
-
Constructor Detail
-
EnumStringTranslator
public EnumStringTranslator(FxTextComponent component, java.lang.Class<T> clazz)
Creates an enum translator.- Parameters:
component- the text componentclazz- the enum class
-
-
Method Detail
-
toViewFunction
public java.util.function.Function<T,java.lang.String> toViewFunction()
Description copied from interface:ValueTranslatorFunction to translate a model value to a view value.- Returns:
- the function
-
toModelFunction
public java.util.function.Function<java.lang.String,T> toModelFunction()
Description copied from interface:ValueTranslatorFunction to translate a view value to a model value.- Returns:
- the function
-
-