com.vaadin.data.converter.
Enum DefaultConverterFactory
- java.lang.Object
-
- java.lang.Enum<DefaultConverterFactory>
-
- com.vaadin.data.converter.DefaultConverterFactory
-
All Implemented Interfaces:
ConverterFactory
,Serializable
,Comparable<DefaultConverterFactory>
public enum DefaultConverterFactory extends Enum<DefaultConverterFactory> implements ConverterFactory
Default implementation of
ConverterFactory
, handling all standard converters defined incom.vaadin.flow.data.converters
package.Since:
8.16
Author:
Vaadin Ltd
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Modifier and Type Method Description <P,M>
Optional<Converter<P,M>>newInstance(Class<P> presentationType, Class<M> modelType)
Attempts to create a
Converter
instance, capable to handle conversion between the given presentation and model types.static DefaultConverterFactory
valueOf(String name)
Returns the enum constant of this type with the specified name.
static DefaultConverterFactory[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DefaultConverterFactory INSTANCE
-
-
Method Detail
-
values
public static DefaultConverterFactory[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DefaultConverterFactory c : DefaultConverterFactory.values()) System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultConverterFactory valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name
- the name of the enum constant to be returned.Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
newInstance
public <P,M> Optional<Converter<P,M>> newInstance(Class<P> presentationType, Class<M> modelType)
Description copied from interface:
ConverterFactory
Attempts to create a
Converter
instance, capable to handle conversion between the given presentation and model types. An emptyOptional
is returned if a conversion cannot be performed.Specified by:
newInstance
in interfaceConverterFactory
Type Parameters:
P
- The presentation type.M
- The model type.Parameters:
presentationType
- presentation type, not null.modelType
- model type, not null.Returns:
a
Converter
instance wrapped into anOptional
, or an emptyOptional
if no suitable converter is available.
-
-