com.vaadin.flow.data.converter.

Enum Class DefaultConverterFactory

java.lang.Object
java.lang.Enum<DefaultConverterFactory>
com.vaadin.flow.data.converter.DefaultConverterFactory

All Implemented Interfaces:

ConverterFactory, Serializable, Comparable<DefaultConverterFactory>, Constable

public enum DefaultConverterFactory extends Enum<DefaultConverterFactory> implements ConverterFactory

Default implementation of ConverterFactory, handling all standard converters defined in com.vaadin.flow.data.converters package.

Since:

Author:

Vaadin Ltd

  • Enum Constant Details

  • Method Details

    • values

      public static DefaultConverterFactory[] values()

      Returns an array containing the constants of this enum class, in the order they are declared.

      Returns:

      an array containing the constants of this enum class, in the order they are declared

    • valueOf

      public static DefaultConverterFactory valueOf(String name)

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name

      NullPointerException - 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 empty Optional is returned if a conversion cannot be performed.

      Specified by:

      newInstance in interface ConverterFactory

      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 an Optional, or an empty Optional if no suitable converter is available.