Class OptionalToContainedObject
- java.lang.Object
-
- de.gebit.integrity.parameter.conversion.Conversion<java.util.Optional,java.lang.Object>
-
- de.gebit.integrity.parameter.conversion.conversions.java.other.OptionalToContainedObject
-
public class OptionalToContainedObject extends Conversion<java.util.Optional,java.lang.Object>
This conversion is necessary to allowOptional
s 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.gebit.integrity.parameter.conversion.Conversion
Conversion.Priority
-
-
Constructor Summary
Constructors Constructor Description OptionalToContainedObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convert(java.util.Optional aSource, java.lang.Class<? extends java.lang.Object> aTargetType, ConversionContext aConversionContext)
Performs the conversion.-
Methods inherited from class de.gebit.integrity.parameter.conversion.Conversion
convertValueRecursive, convertValueToFormattedStringArrayRecursive, setVisitedObjects
-
-
-
-
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 classConversion<java.util.Optional,java.lang.Object>
- Parameters:
aSource
- the source object to convertaTargetType
- TODOaConversionContext
- controls some conversion parameters and rules; may be null if the defaultConversionContext
values shall be used- Returns:
- the converted object
- Throws:
ConversionFailedException
- in case of conversion errors
-
-