ma.glasnost.orika.converter
Class Converter.LegacyConverter<S,D>

java.lang.Object
  extended by ma.glasnost.orika.converter.Converter.LegacyConverter<S,D>
Type Parameters:
S -
D -
All Implemented Interfaces:
Converter<S,D>, MappedTypePair<S,D>
Enclosing interface:
Converter<S,D>

public static class Converter.LegacyConverter<S,D>
extends Object
implements Converter<S,D>

LegacyConverter provides back-compatible support for the older version of converter.

Author:
matt.deboer@gmail.com

Constructor Summary
Converter.LegacyConverter(Converter<S,D> delegate)
           
 
Method Summary
 boolean canConvert(Type<?> sourceClass, Type<?> destinationType)
          Answers whether this converter can be used to handle the conversion of sourceType to destinationType.
 D convert(S source, Type<? extends D> destinationType)
          Perform the conversion of source into a new instance of destinationType.
 Type<S> getAType()
           
 Type<D> getBType()
           
 void setMapperFacade(MapperFacade mapper)
          Store an instance of the current MapperFacade which may be used in mapping of nested types.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Converter.LegacyConverter

public Converter.LegacyConverter(Converter<S,D> delegate)
Method Detail

canConvert

public boolean canConvert(Type<?> sourceClass,
                          Type<?> destinationType)
Description copied from interface: Converter
Answers whether this converter can be used to handle the conversion of sourceType to destinationType.

Specified by:
canConvert in interface Converter<S,D>
Returns:

convert

public D convert(S source,
                 Type<? extends D> destinationType)
Description copied from interface: Converter
Perform the conversion of source into a new instance of destinationType.

Specified by:
convert in interface Converter<S,D>
Parameters:
source - the source object to be converted
destinationType - the destination type to produce
Returns:
a new instance of destinationType

setMapperFacade

public void setMapperFacade(MapperFacade mapper)
Description copied from interface: Converter
Store an instance of the current MapperFacade which may be used in mapping of nested types.

Specified by:
setMapperFacade in interface Converter<S,D>
Parameters:
mapper - the current MapperFacade

toString

public String toString()
Overrides:
toString in class Object

getAType

public Type<S> getAType()
Specified by:
getAType in interface MappedTypePair<S,D>
Returns:
the 'A' type for this mapped pair

getBType

public Type<D> getBType()
Specified by:
getBType in interface MappedTypePair<S,D>
Returns:
the 'B' type for this mapped pair


Copyright © 2013 Glasnost. All Rights Reserved.