Class OptionalToContainedObject


  • public class OptionalToContainedObject
    extends Conversion<java.util.Optional,​java.lang.Object>
    This conversion is necessary to allow Optionals to be used as parameters. It basically resolves them to the contained object (which may have to be converted further afterwards).
    Author:
    Rene Schneider - initial API and implementation
    • Constructor Detail

      • OptionalToContainedObject

        public OptionalToContainedObject()
    • Method Detail

      • convert

        public java.lang.Object convert​(java.util.Optional aSource,
                                        java.lang.Class<? extends java.lang.Object> aTargetType,
                                        ConversionContext aConversionContext)
                                 throws ConversionFailedException
        Description copied from class: Conversion
        Performs the conversion.
        Specified by:
        convert in class Conversion<java.util.Optional,​java.lang.Object>
        Parameters:
        aSource - the source object to convert
        aTargetType - TODO
        aConversionContext - controls some conversion parameters and rules; may be null if the default ConversionContext values shall be used
        Returns:
        the converted object
        Throws:
        ConversionFailedException - in case of conversion errors