You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.data.converter.

Interface ConverterFactory

    • 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.

    • Method Detail

      • 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.