use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class VersionConverterImplV2_0ToV2_1 method downgrade.
@Override
public V2Convertible downgrade(V2Convertible objectToDowngrade) {
Object objectToConvert = objectToDowngrade.getObjectToConvert();
Object targetObject = v2VersionObjectFactory.createEquivalentInstance(objectToConvert, LOWER_VERSION);
MappingContext context = new MappingContext.Factory().getContext();
context.setProperty("downgrade", true);
mapper.map(objectToConvert, targetObject, context);
return new V2Convertible(targetObject, LOWER_VERSION);
}
Aggregations