Interface ConverterFactory

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