org.modelmapper.ComplexConversion Maven / Gradle / Ivy
package org.modelmapper;
import static org.testng.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.modelmapper.config.Configuration.AccessLevel;
import org.modelmapper.spi.MappingContext;
public class ComplexConversion {
public static class PaymentInfo {
int id;
String type;
PaymentInfo(int id, String type) {
this.id = id;
this.type = type;
}
}
public static class Customer {
List info;
List getInfo() {
return info;
}
}
public static class BillingInfoDTO {
int id;
}
public static class ShippingInfoDTO {
int id;
}
public static class CustomerDTO {
List billingInfo;
List shippingInfo;
void setBillingInfo(List billingInfo) {
this.billingInfo = billingInfo;
}
void setShippingInfo(List shippingInfo) {
this.shippingInfo = shippingInfo;
}
}
static class PaymentInfoConverter implements Converter, List