My requirement was to map one Java Object to another. But this was conditional mapping as follows
// Create Y from data in X // If X has a=A and b=B then set p=P in Y else set p=P' // If X has c that starts with "CC" then set q=Q in Y else set q=Q' // so on I explored Dozer & MapStruct, but did not find them apt for supporting above conditions without polluting code with lot of annotations.
Is there any library that cleanly abstracts out such conditional mappings or rules. I mean, some framework that executes rules in a sequence and finally ends up creating Y from X
// Here ChainOfTransformers may be configuration driven transformation logic ExpectedLibrary.map(SourceEntity, DestinationEntity, ChainOfTransformers) Please point me to open source units that I can explore