org.modelmapper.spi
Interface ConditionalConverter<S,D>

Type Parameters:
S - source type
D - destination type
All Superinterfaces:
Converter<S,D>

public interface ConditionalConverter<S,D>
extends Converter<S,D>

Converter that converts supported source objects to instances of destination type D.


Method Summary
 boolean supports(Class<?> sourceType, Class<?> destinationType)
          Indicates whether the Converter supports conversion from the sourceType to the destinationType.
 boolean supportsSource(Class<?> sourceType)
          Returns whether the Converter supports conversion from the sourceType.
 boolean verifiesSource()
          Returns whether the Converter verifies the source type when supports is called.
 
Methods inherited from interface org.modelmapper.Converter
convert
 

Method Detail

supports

boolean supports(Class<?> sourceType,
                 Class<?> destinationType)
Indicates whether the Converter supports conversion from the sourceType to the destinationType. Implementors should only return true for source and destination types that satisfy S and D.

Parameters:
sourceType - to match
destinationType - to match
Returns:
true if conversion is supported, else false

supportsSource

boolean supportsSource(Class<?> sourceType)
Returns whether the Converter supports conversion from the sourceType. Used only for converters where verifiesSource() is false.


verifiesSource

boolean verifiesSource()
Returns whether the Converter verifies the source type when supports is called.



Copyright © 2011. All Rights Reserved.