Class OptionalToFormattedString
- java.lang.Object
-
- de.gebit.integrity.parameter.conversion.Conversion<Optional,FormattedString>
-
- de.gebit.integrity.parameter.conversion.conversions.java.other.OptionalToFormattedString
-
public class OptionalToFormattedString extends Conversion<Optional,FormattedString>
This conversion is necessary to allowOptionals to be displayed correctly in test results. For actual value comparison, the value comparator will already handle Optional resolution, because for that job, non-present optionals must be handled in a special way.- 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 OptionalToFormattedString()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormattedStringconvert(Optional aSource, Class<? extends FormattedString> aTargetType, ConversionContext aConversionContext)Performs the conversion.-
Methods inherited from class de.gebit.integrity.parameter.conversion.Conversion
convertValueRecursive, convertValueToFormattedStringArrayRecursive, setVisitedObjects
-
-
-
-
Method Detail
-
convert
public FormattedString convert(Optional aSource, Class<? extends FormattedString> aTargetType, ConversionContext aConversionContext) throws ConversionFailedException
Description copied from class:ConversionPerforms the conversion.- Specified by:
convertin classConversion<Optional,FormattedString>- Parameters:
aSource- the source object to convertaTargetType- TODOaConversionContext- controls some conversion parameters and rules; may be null if the defaultConversionContextvalues shall be used- Returns:
- the converted object
- Throws:
ConversionFailedException- in case of conversion errors
-
-