Package org.modelmapper.spi
Class StrongTypeConditionalConverter<S,D>
java.lang.Object
org.modelmapper.spi.StrongTypeConditionalConverter<S,D>
- All Implemented Interfaces:
Converter<S,,D> ConditionalConverter<S,D>
public class StrongTypeConditionalConverter<S,D>
extends Object
implements ConditionalConverter<S,D>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.modelmapper.spi.ConditionalConverter
ConditionalConverter.MatchResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(MappingContext<S, D> context) Converts theMappingContext.getSource()to an instance ofMappingContext.getDestinationType().Determines whether the converter matches and supports conversion fromsourceTypetodestinationType.static <S,D> ConditionalConverter<S, D>
-
Constructor Details
-
StrongTypeConditionalConverter
-
-
Method Details
-
wrap
public static <S,D> ConditionalConverter<S,D> wrap(Class<S> sourceType, Class<D> destinationType, Converter<S, D> converter) -
match
Description copied from interface:ConditionalConverterDetermines whether the converter matches and supports conversion fromsourceTypetodestinationType.In the case of a partial match, the converter is indicating that it does not recognise the source type but that it may still be capable performing the conversion implicitly by parsing the result of calling
Object.toString()or by some other means which similarly does not require knowledge of the type at compile time.Implicit conversion may result in conversions which are susceptible to unexpected failure when property types or formats change. Conversion of properties with partially matched types can be disabled via
Configuration.setFullTypeMatchingRequired(boolean).- Specified by:
matchin interfaceConditionalConverter<S,D> - Parameters:
sourceType- to matchdestinationType- to match- Returns:
ConditionalConverter.MatchResult.FULLifsourceTypeanddestinationTypeare matchedConditionalConverter.MatchResult.PARTIALifdestinationTypeis matchedConditionalConverter.MatchResult.NONEifdestinationTypeis not matched
-
convert
Description copied from interface:ConverterConverts theMappingContext.getSource()to an instance ofMappingContext.getDestinationType().
-