Interface ConverterFactory

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    DefaultConverterFactory

    public interface ConverterFactory
    extends java.io.Serializable
    Creates Converter instances 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 a Converter instance, 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 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.