forked from elaatifi/orika
-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Description
jdk 1.8
maven:
ma.glasnost.orika
orika-core
1.5.1
my test code:
`@Data
@AllArgsConstructor
public class NotifyMsg {
private Long uid;
private T msgData;
}
@DaTa
@AllArgsConstructor
public class DeviceNotify {
private String did;
private String state;
}
public static void main(String[] args) {
DeviceNotify deviceNotify = new DeviceNotify("test", "active");
NotifyMsg notifyMsg = new NotifyMsg<>(111L, deviceNotify);
MapperFactory factory = new DefaultMapperFactory.Builder().build();
Type<NotifyMsg<DeviceNotify>> sourceType = new TypeBuilder<NotifyMsg<DeviceNotify>>() {
}.build();
Type<NotifyMsg<DeviceNotify>> targetType = new TypeBuilder<NotifyMsg<DeviceNotify>>() {
}.build();
factory.classMap(sourceType, targetType).byDefault().register();
NotifyMsg<DeviceNotify> targetObj = factory.getMapperFacade().map(notifyMsg, sourceType, targetType);
System.out.println(targetObj);
}
`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
