be.idamf.sofa.mapper
Class AbstractBidirectionalStrategyMapper<A,B>
java.lang.Object
be.idamf.sofa.mapper.AbstractMapper<A,B>
be.idamf.sofa.mapper.AbstractBidirectionalMapper<A,B>
be.idamf.sofa.mapper.AbstractBidirectionalStrategyMapper<A,B>
- Type Parameters:
A - The object type AB - The object type B
- All Implemented Interfaces:
- BidirectionalMapper<A,B>, Mapper<A,B>, StrategyMapper<A,B>
public abstract class AbstractBidirectionalStrategyMapper<A,B>
- extends AbstractBidirectionalMapper<A,B>
- implements StrategyMapper<A,B>
Abstract mapper class, implementing the B to A mapping methods as delegation to the strategy.
Implementing classes must provide a default StrategyMapper. This strategy will be used when calling
BidirectionalMapper.mapBToA(Object).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractBidirectionalStrategyMapper
protected AbstractBidirectionalStrategyMapper(MapperStrategy<A,B> defaultStrategy)
- This constructor foreces implementation to always pass in a default strategy, so it can be used when
BidirectionalMapper.mapBToA(Object) is called.
- Parameters:
defaultStrategy - the default strategy
mapBToA
public A mapBToA(B b,
MapperStrategy<A,B> strategy)
- Map an object of type B to an object of type A, using a given strategy.
- Specified by:
mapBToA in interface StrategyMapper<A,B>
- Parameters:
b - the object of type Bstrategy - the strategy
- Returns:
- an object of type A
mapBToA
public A mapBToA(B b)
- Map an object of type B to an object of type A.
- Specified by:
mapBToA in interface BidirectionalMapper<A,B>
- Parameters:
b - the object of type B
- Returns:
- an object of type A
mapCollectionOfBToCollectionOfA
public <C extends Collection<A>> C mapCollectionOfBToCollectionOfA(Collection<B> collectionOfB,
C emptyMutableCollectionOfA,
MapperStrategy<A,B> strategy)
- Maps a collection of objects of type B to a collection of objects of type A, using a strategy.
- Specified by:
mapCollectionOfBToCollectionOfA in interface StrategyMapper<A,B>
- Parameters:
collectionOfB - the collection of objects of type Bstrategy - the strategy
- Returns:
- a collection of objects of type A
Copyright © 2013 iDA-MediaFoundry. All Rights Reserved.