com.remondis.remap.MapperAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of remap Show documentation
Show all versions of remap Show documentation
A declarative mapping library for converting objects field by field.
The newest version!
package com.remondis.remap;
/**
* An implementation to generalize a {@link Mapper} using {@link InternalMapper}.
*
* @param the source type
* @param the destination type.
*/
class MapperAdapter implements InternalMapper {
private Mapper mapper;
public MapperAdapter(Mapper mapper) {
super();
this.mapper = mapper;
}
@Override
public D map(S source, D destination) {
return mapper.map(source, destination);
}
@Override
public D map(S source) {
return mapper.map(source);
}
@Override
public Projection getProjection() {
Class source = mapper.getMapping()
.getSource();
Class destination = mapper.getMapping()
.getDestination();
return new Projection<>(source, destination);
}
Mapper getMapper() {
return mapper;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy