com.vaadin.flow.data.converter.

Interface ConverterFactory

All Superinterfaces:

Serializable

All Known Implementing Classes:

DefaultConverterFactory

public interface ConverterFactory extends Serializable

Creates Converter instances capable to handle conversion between a model and a presentation type.

Since:

Author:

Vaadin Ltd

  • Method Summary

    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.

  • Method Details

    • newInstance

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