Class Source {
private String type;
private Object identifier;
}
The identifier could be an object of class AppointmentIdentifier or JobIdentifier; I have to map Source to Target, which has below structure.
Class Target {
private String type;
private Object identifierBO;
}
The identifierBO could an object of class AppointmentIdentifierBO or JobIdentifierBO. Below is my Mapper class:
@Mapper
public interface ModelMapper {
Target toTarget(@NonNull final Source source);
AppointmentIdentifierBO toAppointmentIdentifierBO(AppointmentIdentifier appointmentIdentifier);
JobBO toJobBO(JobIdentifier jobIdentifier);
}
I know, I am missing some configuration which will help mapping identifier to identifierBO, but could not help.