Package org.modelmapper.spi
Interface ConditionalConverter<S,D>
- Type Parameters:
S
- source typeD
- destination type
- All Superinterfaces:
Converter<S,
D>
- All Known Implementing Classes:
StrongTypeConditionalConverter
Conditionally converts matching source objects to instances of destination type
D
.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionDetermines whether the converter matches and supports conversion fromsourceType
todestinationType
.
-
Method Details
-
match
Determines whether the converter matches and supports conversion fromsourceType
todestinationType
.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)
.- Parameters:
sourceType
- to matchdestinationType
- to match- Returns:
ConditionalConverter.MatchResult.FULL
ifsourceType
anddestinationType
are matchedConditionalConverter.MatchResult.PARTIAL
ifdestinationType
is matchedConditionalConverter.MatchResult.NONE
ifdestinationType
is not matched
-