Package com.vaadin.data.converter
Interface ConverterFactory
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
DefaultConverterFactory
public interface ConverterFactory extends java.io.SerializableCreatesConverterinstances capable to handle conversion between a model and a presentation type.- Since:
- 8.16
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <P,M>
java.util.Optional<Converter<P,M>>newInstance(java.lang.Class<P> presentationType, java.lang.Class<M> modelType)Attempts to create aConverterinstance, capable to handle conversion between the given presentation and model types.
-
-
-
Method Detail
-
newInstance
<P,M> java.util.Optional<Converter<P,M>> newInstance(java.lang.Class<P> presentationType, java.lang.Class<M> modelType)
Attempts to create aConverterinstance, capable to handle conversion between the given presentation and model types. An emptyOptionalis returned if a conversion cannot be performed.- Type Parameters:
P- The presentation type.M- The model type.- Parameters:
presentationType- presentation type, not null.modelType- model type, not null.- Returns:
- a
Converterinstance wrapped into anOptional, or an emptyOptionalif no suitable converter is available.
-
-