├── .gitignore ├── README.md ├── pom.xml └── src └── main ├── java └── me │ └── sokolenko │ └── test │ └── compareConverters │ ├── Converter.java │ ├── Main.java │ ├── dozer │ └── DozerConverter.java │ ├── manual │ └── ManualConverter.java │ ├── model │ ├── source │ │ ├── Availability.java │ │ ├── Brand.java │ │ ├── Category.java │ │ ├── Image.java │ │ ├── Link.java │ │ ├── LinkType.java │ │ ├── Parameter.java │ │ ├── ParentCategory.java │ │ ├── Price.java │ │ ├── Product.java │ │ ├── Resource.java │ │ ├── ResourceType.java │ │ └── ShippingRule.java │ └── target │ │ ├── Availability.java │ │ ├── Brand.java │ │ ├── Category.java │ │ ├── Image.java │ │ ├── Link.java │ │ ├── LinkType.java │ │ ├── Parameter.java │ │ ├── ParentCategory.java │ │ ├── Price.java │ │ ├── Product.java │ │ ├── Resource.java │ │ ├── ResourceType.java │ │ └── ShippingRule.java │ └── orika │ └── OrikaConverter.java └── resources ├── log4j.properties └── me └── sokolenko └── test └── compareConverters └── dozer └── dozer-mapping.xml /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .idea 3 | *.iml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Compare Java Converters 2 | ======================= 3 | 4 | This repository has small test to compare performance of popular Java object conversion libraries. 5 | Results of tests execution are available at http://blog.sokolenko.me/2013/05/dozer-vs-orika-vs-manual.html 6 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | me.sokolenko.test 6 | compare-converters 7 | 1.0.0-SNAPSHOT 8 | jar 9 | 10 | 11 | 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | 16 | 1.6 17 | 1.6 18 | 19 | 20 | 21 | 22 | org.apache.maven.plugins 23 | maven-assembly-plugin 24 | 25 | 26 | 27 | package 28 | 29 | single 30 | 31 | 32 | 33 | 34 | 35 | me.sokolenko.test.compareConverters.Main 36 | 37 | 38 | 39 | jar-with-dependencies 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | uk.co.jemos.podam 51 | podam 52 | 3.0.2.RELEASE 53 | 54 | 55 | 56 | net.sf.dozer 57 | dozer 58 | 5.4.0 59 | 60 | 61 | 62 | ma.glasnost.orika 63 | orika-core 64 | 1.4.1 65 | 66 | 67 | 68 | log4j 69 | log4j 70 | 1.2.17 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/Converter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters; 2 | 3 | import me.sokolenko.test.compareConverters.model.source.Category; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public interface Converter { 9 | 10 | me.sokolenko.test.compareConverters.model.target.Category map(Category source); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/Main.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters; 2 | 3 | import me.sokolenko.test.compareConverters.dozer.DozerConverter; 4 | import me.sokolenko.test.compareConverters.manual.ManualConverter; 5 | import me.sokolenko.test.compareConverters.model.source.Category; 6 | import me.sokolenko.test.compareConverters.orika.OrikaConverter; 7 | import org.apache.commons.lang3.StringUtils; 8 | import uk.co.jemos.podam.api.PodamFactory; 9 | import uk.co.jemos.podam.api.PodamFactoryImpl; 10 | 11 | import java.util.Arrays; 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | 15 | /** 16 | * @author Anatoliy Sokolenko 17 | */ 18 | public class Main { 19 | 20 | private static final Map CONVERTERS = new HashMap() {{ 21 | put("dozer", DozerConverter.class); 22 | put("orika", OrikaConverter.class); 23 | put("manual", ManualConverter.class); 24 | }}; 25 | 26 | public static void main(String[] args) { 27 | if (args.length < 2) { 28 | throw new IllegalArgumentException("Not all mandatory properties specified. " + 29 | "Please specify converter name and number of iterations you would like to perform"); 30 | } 31 | 32 | Converter converter = getConverter(args); 33 | int iterationsCount = getIterationsCount(args); 34 | 35 | PodamFactory randomizer = new PodamFactoryImpl(); 36 | int[] latencies = new int[iterationsCount]; 37 | for (int i = 0; i < iterationsCount; i++) { 38 | Category category = randomizer.manufacturePojo(Category.class); 39 | 40 | long start = System.nanoTime(); 41 | 42 | me.sokolenko.test.compareConverters.model.target.Category result = converter.map(category); 43 | 44 | long end = System.nanoTime(); 45 | 46 | latencies[i] = (int) (end - start); 47 | } 48 | 49 | printResults(latencies); 50 | } 51 | 52 | private static void printResults(int[] latencies) { 53 | Arrays.sort(latencies); 54 | 55 | System.out.println("Min " + latencies[0]); 56 | System.out.println("Mid " + latencies[latencies.length / 2]); 57 | System.out.println("90% " + latencies[((int) (latencies.length * 0.9))]); 58 | System.out.println("95% " + latencies[((int) (latencies.length * 0.95))]); 59 | System.out.println("99% " + latencies[((int) (latencies.length * 0.99))]); 60 | System.out.println("99.9% " + latencies[((int) (latencies.length * 0.999))]); 61 | System.out.println("99.99% " + latencies[((int) (latencies.length * 0.9999))]); 62 | System.out.println("99.999% " + latencies[((int) (latencies.length * 0.99999))]); 63 | System.out.println("99.9999% " + latencies[((int) (latencies.length * 0.999999))]); 64 | System.out.println("Max " + latencies[latencies.length - 1]); 65 | } 66 | 67 | private static Converter getConverter(String[] args) { 68 | try { 69 | String conterterName = args[0]; 70 | Class converterClass = CONVERTERS.get(conterterName); 71 | if (converterClass == null) { 72 | throw new IllegalArgumentException("Please specify known converter: " + StringUtils.join(CONVERTERS.keySet().toArray())); 73 | } 74 | return (Converter) converterClass.newInstance(); 75 | } catch (InstantiationException e) { 76 | throw new IllegalArgumentException("Converter class should have default public constructor"); 77 | } catch (IllegalAccessException e) { 78 | throw new IllegalArgumentException("Converter class should have default public constructor"); 79 | } 80 | } 81 | 82 | private static int getIterationsCount(String[] args) { 83 | try { 84 | int iterationsCount; 85 | String iterationsString = args[1]; 86 | iterationsCount = Integer.valueOf(iterationsString); 87 | if (iterationsCount <= 0) { 88 | throw new IllegalArgumentException("Iterations count should be greater than zero"); 89 | } 90 | return iterationsCount; 91 | } catch (NumberFormatException e) { 92 | throw new IllegalArgumentException("Iterations count should be valid integer"); 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/dozer/DozerConverter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.dozer; 2 | 3 | import me.sokolenko.test.compareConverters.Converter; 4 | import me.sokolenko.test.compareConverters.model.source.Category; 5 | import org.dozer.DozerBeanMapper; 6 | import org.dozer.Mapper; 7 | 8 | /** 9 | * @author Anatoliy Sokolenko 10 | */ 11 | public class DozerConverter implements Converter { 12 | 13 | private final Mapper mapper; 14 | 15 | public DozerConverter() { 16 | DozerBeanMapper mapper = new DozerBeanMapper(); 17 | mapper.addMapping(getClass().getResourceAsStream("dozer-mapping.xml")); 18 | 19 | this.mapper = mapper; 20 | } 21 | 22 | @Override 23 | public me.sokolenko.test.compareConverters.model.target.Category map(Category source) { 24 | return mapper.map(source, me.sokolenko.test.compareConverters.model.target.Category.class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/manual/ManualConverter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.manual; 2 | 3 | import me.sokolenko.test.compareConverters.Converter; 4 | import me.sokolenko.test.compareConverters.model.target.Resource; 5 | import me.sokolenko.test.compareConverters.model.target.ResourceType; 6 | import me.sokolenko.test.compareConverters.model.target.Parameter; 7 | import me.sokolenko.test.compareConverters.model.target.Availability; 8 | import me.sokolenko.test.compareConverters.model.target.Brand; 9 | import me.sokolenko.test.compareConverters.model.target.Category; 10 | import me.sokolenko.test.compareConverters.model.target.Image; 11 | import me.sokolenko.test.compareConverters.model.target.Link; 12 | import me.sokolenko.test.compareConverters.model.target.LinkType; 13 | import me.sokolenko.test.compareConverters.model.target.ParentCategory; 14 | import me.sokolenko.test.compareConverters.model.target.Price; 15 | import me.sokolenko.test.compareConverters.model.target.Product; 16 | import me.sokolenko.test.compareConverters.model.target.ShippingRule; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Date; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | /** 25 | * @author Anatoliy Sokolenko 26 | */ 27 | public class ManualConverter implements Converter { 28 | @Override 29 | public Category map(me.sokolenko.test.compareConverters.model.source.Category source) { 30 | Category target = new Category(); 31 | target.setId(source.getId()); 32 | target.setCategoryName(source.getName()); 33 | target.setProducts(toTarget(source.getProducts())); 34 | target.setShipping(toTarget(source.getShipping())); 35 | target.setUrl(source.getUrl()); 36 | target.setVisible(source.isVisible()); 37 | target.setType(source.getType()); 38 | target.setHasChildren(source.isHasChildren()); 39 | target.setRelatedIds(source.getRelatedIds()); 40 | target.setFrom(new Date(source.getFrom().getTime())); 41 | target.setClearanceStartDays(source.getClearanceStartDays()); 42 | target.setPosition(source.getPosition()); 43 | target.setCountryEligible(source.getCountryEligible()); 44 | target.setNew(source.isNew()); 45 | target.setActive(source.getActive()); 46 | target.setParameters(toTargetParameters(source.getParameters())); 47 | target.setPrimaryImageSource(source.getPrimaryImageSource()); 48 | target.setPrimaryPortraitSource(source.getPrimaryPortraitSource()); 49 | target.setAvailableTo(source.getAvailableTo()); 50 | target.setAuthor(source.getAuthor()); 51 | target.setCreatedAt(new Date(source.getCreatedAt().getTime())); 52 | target.setUpdatedAt(new Date(source.getUpdatedAt().getTime())); 53 | target.setParentCategory(toTarget(source.getParentCategory())); 54 | target.setDomainValues(source.getDomainValues()); 55 | target.setPrimaryImage(toTarget(source.getPrimaryImage())); 56 | target.setSecondaryImages(toTargetImages(source.getSecondaryImages())); 57 | target.setBrand(toTarget(source.getBrand())); 58 | target.setPopularity(source.getPopularity()); 59 | target.setCopies(source.getCopies()); 60 | target.setResources(toTargetAssets(source.getResources())); 61 | 62 | return target; 63 | } 64 | 65 | private List toTargetAssets(List source) { 66 | List target = new ArrayList(); 67 | 68 | for (me.sokolenko.test.compareConverters.model.source.Resource sourceAsset : source) { 69 | target.add(toTarget(sourceAsset)); 70 | } 71 | 72 | return target; 73 | } 74 | 75 | private Resource toTarget(me.sokolenko.test.compareConverters.model.source.Resource source) { 76 | Resource target = new Resource(); 77 | target.setId(source.getId()); 78 | target.setDescription(source.getDescription()); 79 | target.setFileName(source.getFileName()); 80 | target.setLinks(toTargetLinks(source.getLinks())); 81 | target.setHeight(source.getHeight()); 82 | target.setWidth(source.getWidth()); 83 | target.setText(source.getText()); 84 | target.setType(toTarget(source.getType())); 85 | target.setParameters(toTargetParameters(source.getParameters())); 86 | 87 | return target; 88 | } 89 | 90 | private List toTargetLinks(List source) { 91 | List target = new ArrayList(); 92 | 93 | for (me.sokolenko.test.compareConverters.model.source.Link sourceLink : source) { 94 | target.add(toTarget(sourceLink)); 95 | } 96 | 97 | return target; 98 | } 99 | 100 | private Link toTarget(me.sokolenko.test.compareConverters.model.source.Link source) { 101 | Link target = new Link(); 102 | target.setText(source.getText()); 103 | target.setPosition(source.getPosition()); 104 | target.setParameters(toTargetParameters(source.getParameters())); 105 | target.setLinkType(toTarget(source.getLinkType())); 106 | target.setValue(source.getValue()); 107 | 108 | return target; 109 | } 110 | 111 | private LinkType toTarget(me.sokolenko.test.compareConverters.model.source.LinkType source) { 112 | return LinkType.valueOf(source.name()); 113 | } 114 | 115 | private ResourceType toTarget(me.sokolenko.test.compareConverters.model.source.ResourceType source) { 116 | return ResourceType.valueOf(source.name()); 117 | } 118 | 119 | private Brand toTarget(me.sokolenko.test.compareConverters.model.source.Brand source) { 120 | Brand target = new Brand(); 121 | target.setBrandName(source.getBrandName()); 122 | target.setRightOwner(source.getRightOwner()); 123 | 124 | return target; 125 | } 126 | 127 | private List toTargetImages(List source) { 128 | List target = new ArrayList(); 129 | 130 | for (me.sokolenko.test.compareConverters.model.source.Image sourceImage : source) { 131 | target.add(toTarget(sourceImage)); 132 | } 133 | 134 | return target; 135 | } 136 | 137 | private Image toTarget(me.sokolenko.test.compareConverters.model.source.Image source) { 138 | Image target = new Image(); 139 | target.setName(source.getName()); 140 | target.setSeq(source.getSeq()); 141 | 142 | return target; 143 | } 144 | 145 | private ParentCategory toTarget(me.sokolenko.test.compareConverters.model.source.ParentCategory source) { 146 | ParentCategory target = new ParentCategory(); 147 | target.setId(source.getId()); 148 | target.setName(source.getName()); 149 | 150 | return target; 151 | } 152 | 153 | private List toTargetParameters(List source) { 154 | List target = new ArrayList(source.size()); 155 | 156 | for (me.sokolenko.test.compareConverters.model.source.Parameter sourceParameter : source) { 157 | target.add(toTarget(sourceParameter)); 158 | } 159 | 160 | return target; 161 | } 162 | 163 | private ShippingRule toTarget(me.sokolenko.test.compareConverters.model.source.ShippingRule source) { 164 | ShippingRule target = new ShippingRule(); 165 | target.setReturnConstraints(source.getReturnConstraints()); 166 | target.setNotes(source.getNotes()); 167 | target.setGiftable(source.getGiftable()); 168 | target.setShipDays(source.getShipDays()); 169 | 170 | return target; 171 | } 172 | 173 | private ArrayList toTarget(List source) { 174 | ArrayList products = new ArrayList(); 175 | for (me.sokolenko.test.compareConverters.model.source.Product sourceProduct : source) { 176 | Product targetProduct = new Product(); 177 | targetProduct.setId(sourceProduct.getId()); 178 | targetProduct.setPrice(toTarget(sourceProduct.getPrice())); 179 | targetProduct.setAvailability(toTarget(sourceProduct.getAvailability())); 180 | targetProduct.setIndicator(sourceProduct.getIndicator()); 181 | targetProduct.setEnabled(sourceProduct.isEnabled()); 182 | targetProduct.setAddByApp(sourceProduct.getAddByApp()); 183 | targetProduct.setDescription(sourceProduct.getDescription()); 184 | targetProduct.setCode(sourceProduct.getCode()); 185 | targetProduct.setExpired(sourceProduct.getExpired()); 186 | targetProduct.setSurchargeFee(sourceProduct.getSurchargeFee()); 187 | targetProduct.setHistory(sourceProduct.isHistory()); 188 | targetProduct.setOrderable(sourceProduct.isOrderable()); 189 | targetProduct.setBackorderable(sourceProduct.isBackorderable()); 190 | targetProduct.setParameters(toTarget(sourceProduct.getAttributes())); 191 | targetProduct.setActive(sourceProduct.getActive()); 192 | 193 | products.add(targetProduct); 194 | } 195 | return products; 196 | } 197 | 198 | private Map toTarget(Map source) { 199 | Map target = new HashMap(source.size()); 200 | 201 | for (Map.Entry sourceEntry : source.entrySet()) { 202 | target.put(sourceEntry.getKey(), toTarget(sourceEntry.getValue())); 203 | } 204 | 205 | return target; 206 | } 207 | 208 | private Parameter toTarget(me.sokolenko.test.compareConverters.model.source.Parameter source) { 209 | Parameter target = new Parameter(); 210 | target.setName(source.getName()); 211 | target.setHidden(source.isHidden()); 212 | target.setOrder(source.getOrder()); 213 | 214 | List targetValues = new ArrayList(); 215 | for (String sourceValue : source.getValues()) { 216 | targetValues.add(sourceValue); 217 | } 218 | 219 | target.setValues(targetValues); 220 | 221 | return target; 222 | } 223 | 224 | private Availability toTarget(me.sokolenko.test.compareConverters.model.source.Availability source) { 225 | Availability target = new Availability(); 226 | target.setSource(source.getSource()); 227 | target.setAvailable(source.isAvailable()); 228 | 229 | return target; 230 | } 231 | 232 | private Price toTarget(me.sokolenko.test.compareConverters.model.source.Price source) { 233 | Price target = new Price(); 234 | target.setOriginalPrice(source.getOriginalPrice()); 235 | target.setPreviousPrice(source.getPreviousPrice()); 236 | target.setRetailPrice(source.getRetailPrice()); 237 | target.setSalePrice(source.getSalePrice()); 238 | target.setFrom(new Date(source.getFrom().getTime())); 239 | target.setTo(new Date(source.getTo().getTime())); 240 | target.setDescription(source.getDescription()); 241 | target.setOnSale(source.isOnSale()); 242 | 243 | return target; 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Availability.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Availability { 7 | 8 | private Boolean available; 9 | 10 | private String source; 11 | 12 | public Boolean isAvailable() { 13 | return available; 14 | } 15 | 16 | public void setAvailable(Boolean available) { 17 | this.available = available; 18 | } 19 | 20 | public String getSource() { 21 | return source; 22 | } 23 | 24 | public void setSource(String source) { 25 | this.source = source; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Brand.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Brand { 7 | 8 | private String brandName; 9 | 10 | private String rightOwner; 11 | 12 | public String getBrandName() { 13 | return brandName; 14 | } 15 | 16 | public void setBrandName(String brandName) { 17 | this.brandName = brandName; 18 | } 19 | 20 | public String getRightOwner() { 21 | return rightOwner; 22 | } 23 | 24 | public void setRightOwner(String rightOwner) { 25 | this.rightOwner = rightOwner; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Category.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.Collection; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | /** 8 | * @author Anatoliy Sokolenko 9 | */ 10 | public class Category { 11 | 12 | private int id; 13 | 14 | private String name; 15 | 16 | private List products; 17 | 18 | private ShippingRule shipping; 19 | 20 | private String url; 21 | 22 | private boolean visible; 23 | 24 | private String type; 25 | 26 | private boolean hasChildren; 27 | 28 | private List relatedIds; 29 | 30 | private Date from; 31 | 32 | private Integer clearanceStartDays; 33 | 34 | private int position; 35 | 36 | private Boolean countryEligible; 37 | 38 | private boolean isNew; 39 | 40 | private Boolean active; 41 | 42 | private List parameters; 43 | 44 | private String primaryImageSource; 45 | 46 | private String primaryPortraitSource; 47 | 48 | private List availableTo; 49 | 50 | private String author; 51 | 52 | private Date createdAt; 53 | 54 | private Date updatedAt; 55 | 56 | private ParentCategory parentCategory; 57 | 58 | private Collection domainValues; 59 | 60 | private Image primaryImage; 61 | 62 | private List secondaryImages; 63 | 64 | private Brand brand; 65 | 66 | private Double popularity; 67 | 68 | private Integer copies; 69 | 70 | private List resources; 71 | 72 | public Category() { 73 | } 74 | 75 | public int getId() { 76 | return id; 77 | } 78 | 79 | public void setId(int id) { 80 | this.id = id; 81 | } 82 | 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | public void setName(String name) { 88 | this.name = name; 89 | } 90 | 91 | public List getProducts() { 92 | return products; 93 | } 94 | 95 | public void setProducts(List products) { 96 | this.products = products; 97 | } 98 | 99 | public ShippingRule getShipping() { 100 | return shipping; 101 | } 102 | 103 | public void setShipping(ShippingRule shipping) { 104 | this.shipping = shipping; 105 | } 106 | 107 | public String getUrl() { 108 | return url; 109 | } 110 | 111 | public void setUrl(String url) { 112 | this.url = url; 113 | } 114 | 115 | public boolean isVisible() { 116 | return visible; 117 | } 118 | 119 | public void setVisible(boolean visible) { 120 | this.visible = visible; 121 | } 122 | 123 | public String getType() { 124 | return type; 125 | } 126 | 127 | public void setType(String type) { 128 | this.type = type; 129 | } 130 | 131 | public boolean isHasChildren() { 132 | return hasChildren; 133 | } 134 | 135 | public void setHasChildren(boolean hasChildren) { 136 | this.hasChildren = hasChildren; 137 | } 138 | 139 | public List getRelatedIds() { 140 | return relatedIds; 141 | } 142 | 143 | public void setRelatedIds(List relatedIds) { 144 | this.relatedIds = relatedIds; 145 | } 146 | 147 | public Date getFrom() { 148 | return from; 149 | } 150 | 151 | public void setFrom(Date from) { 152 | this.from = from; 153 | } 154 | 155 | public Integer getClearanceStartDays() { 156 | return clearanceStartDays; 157 | } 158 | 159 | public void setClearanceStartDays(Integer clearanceStartDays) { 160 | this.clearanceStartDays = clearanceStartDays; 161 | } 162 | 163 | public int getPosition() { 164 | return position; 165 | } 166 | 167 | public void setPosition(int position) { 168 | this.position = position; 169 | } 170 | 171 | public Boolean getCountryEligible() { 172 | return countryEligible; 173 | } 174 | 175 | public void setCountryEligible(Boolean countryEligible) { 176 | this.countryEligible = countryEligible; 177 | } 178 | 179 | public boolean isNew() { 180 | return isNew; 181 | } 182 | 183 | public void setNew(boolean aNew) { 184 | isNew = aNew; 185 | } 186 | 187 | public Boolean getActive() { 188 | return active; 189 | } 190 | 191 | public void setActive(Boolean active) { 192 | this.active = active; 193 | } 194 | 195 | public List getParameters() { 196 | return parameters; 197 | } 198 | 199 | public void setParameters(List parameters) { 200 | this.parameters = parameters; 201 | } 202 | 203 | public String getPrimaryImageSource() { 204 | return primaryImageSource; 205 | } 206 | 207 | public void setPrimaryImageSource(String primaryImageSource) { 208 | this.primaryImageSource = primaryImageSource; 209 | } 210 | 211 | public String getPrimaryPortraitSource() { 212 | return primaryPortraitSource; 213 | } 214 | 215 | public void setPrimaryPortraitSource(String primaryPortraitSource) { 216 | this.primaryPortraitSource = primaryPortraitSource; 217 | } 218 | 219 | public List getAvailableTo() { 220 | return availableTo; 221 | } 222 | 223 | public void setAvailableTo(List availableTo) { 224 | this.availableTo = availableTo; 225 | } 226 | 227 | public String getAuthor() { 228 | return author; 229 | } 230 | 231 | public void setAuthor(String author) { 232 | this.author = author; 233 | } 234 | 235 | public Date getCreatedAt() { 236 | return createdAt; 237 | } 238 | 239 | public void setCreatedAt(Date createdAt) { 240 | this.createdAt = createdAt; 241 | } 242 | 243 | public Date getUpdatedAt() { 244 | return updatedAt; 245 | } 246 | 247 | public void setUpdatedAt(Date updatedAt) { 248 | this.updatedAt = updatedAt; 249 | } 250 | 251 | public ParentCategory getParentCategory() { 252 | return parentCategory; 253 | } 254 | 255 | public void setParentCategory(ParentCategory parentCategory) { 256 | this.parentCategory = parentCategory; 257 | } 258 | 259 | public Collection getDomainValues() { 260 | return domainValues; 261 | } 262 | 263 | public void setDomainValues(Collection domainValues) { 264 | this.domainValues = domainValues; 265 | } 266 | 267 | public Image getPrimaryImage() { 268 | return primaryImage; 269 | } 270 | 271 | public void setPrimaryImage(Image primaryImage) { 272 | this.primaryImage = primaryImage; 273 | } 274 | 275 | public List getSecondaryImages() { 276 | return secondaryImages; 277 | } 278 | 279 | public void setSecondaryImages(List secondaryImages) { 280 | this.secondaryImages = secondaryImages; 281 | } 282 | 283 | public Brand getBrand() { 284 | return brand; 285 | } 286 | 287 | public void setBrand(Brand brand) { 288 | this.brand = brand; 289 | } 290 | 291 | public Double getPopularity() { 292 | return popularity; 293 | } 294 | 295 | public void setPopularity(Double popularity) { 296 | this.popularity = popularity; 297 | } 298 | 299 | public Integer getCopies() { 300 | return copies; 301 | } 302 | 303 | public void setCopies(Integer copies) { 304 | this.copies = copies; 305 | } 306 | 307 | public List getResources() { 308 | return resources; 309 | } 310 | 311 | public void setResources(List resources) { 312 | this.resources = resources; 313 | } 314 | } 315 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Image.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Image { 7 | 8 | private String name; 9 | 10 | private Integer seq; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | public Integer getSeq() { 21 | return seq; 22 | } 23 | 24 | public void setSeq(Integer seq) { 25 | this.seq = seq; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Link.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class Link { 10 | 11 | private String position; 12 | 13 | private String text; 14 | 15 | private LinkType linkType; 16 | 17 | private String value; 18 | 19 | private List parameters = new ArrayList(); 20 | 21 | public String getPosition() { 22 | return position; 23 | } 24 | 25 | public void setPosition(String position) { 26 | this.position = position; 27 | } 28 | 29 | public String getText() { 30 | return text; 31 | } 32 | 33 | public void setText(String text) { 34 | this.text = text; 35 | } 36 | 37 | public LinkType getLinkType() { 38 | return linkType; 39 | } 40 | 41 | public void setLinkType(LinkType linkType) { 42 | this.linkType = linkType; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | public List getParameters() { 54 | return parameters; 55 | } 56 | 57 | public void setParameters(List parameters) { 58 | this.parameters = parameters; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/LinkType.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public enum LinkType { 7 | 8 | BANNER, COMMERCIAL, PANEL, IMAGE, ICON, LIST 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Parameter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Parameter { 9 | 10 | private String name; 11 | 12 | private List values; 13 | 14 | private int order; 15 | 16 | private boolean hidden; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public List getValues() { 27 | return values; 28 | } 29 | 30 | public void setValues(List values) { 31 | this.values = values; 32 | } 33 | 34 | public int getOrder() { 35 | return order; 36 | } 37 | 38 | public void setOrder(int order) { 39 | this.order = order; 40 | } 41 | 42 | public boolean isHidden() { 43 | return hidden; 44 | } 45 | 46 | public void setHidden(boolean hidden) { 47 | this.hidden = hidden; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/ParentCategory.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class ParentCategory { 7 | 8 | private int id; 9 | 10 | private String name; 11 | 12 | public ParentCategory() { 13 | } 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public void setId(int id) { 20 | this.id = id; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Price.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.sql.Date; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Price { 9 | 10 | private double originalPrice; 11 | 12 | private double previousPrice; 13 | 14 | private double retailPrice; 15 | 16 | private double salePrice; 17 | 18 | private Date from; 19 | 20 | private Date to; 21 | 22 | private String description; 23 | 24 | private boolean onSale; 25 | 26 | public Price() { 27 | } 28 | 29 | public double getOriginalPrice() { 30 | return originalPrice; 31 | } 32 | 33 | public void setOriginalPrice(double originalPrice) { 34 | this.originalPrice = originalPrice; 35 | } 36 | 37 | public double getPreviousPrice() { 38 | return previousPrice; 39 | } 40 | 41 | public void setPreviousPrice(double previousPrice) { 42 | this.previousPrice = previousPrice; 43 | } 44 | 45 | public double getRetailPrice() { 46 | return retailPrice; 47 | } 48 | 49 | public void setRetailPrice(double retailPrice) { 50 | this.retailPrice = retailPrice; 51 | } 52 | 53 | public double getSalePrice() { 54 | return salePrice; 55 | } 56 | 57 | public void setSalePrice(double salePrice) { 58 | this.salePrice = salePrice; 59 | } 60 | 61 | public Date getFrom() { 62 | return from; 63 | } 64 | 65 | public void setFrom(Date from) { 66 | this.from = from; 67 | } 68 | 69 | public Date getTo() { 70 | return to; 71 | } 72 | 73 | public void setTo(Date to) { 74 | this.to = to; 75 | } 76 | 77 | public String getDescription() { 78 | return description; 79 | } 80 | 81 | public void setDescription(String description) { 82 | this.description = description; 83 | } 84 | 85 | public boolean isOnSale() { 86 | return onSale; 87 | } 88 | 89 | public void setOnSale(boolean onSale) { 90 | this.onSale = onSale; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Product.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Product { 9 | 10 | private Integer id; 11 | 12 | private Price price; 13 | 14 | private Availability availability; 15 | 16 | private String indicator; 17 | 18 | private boolean enabled; 19 | 20 | private String addByApp; 21 | 22 | private String description; 23 | 24 | private String code; 25 | 26 | private Boolean expired; 27 | 28 | private double surchargeFee; 29 | 30 | private boolean history; 31 | 32 | private boolean orderable; 33 | 34 | private boolean backorderable; 35 | 36 | private Map attributes; 37 | 38 | private Boolean active; 39 | 40 | public Integer getId() { 41 | return id; 42 | } 43 | 44 | public void setId(Integer id) { 45 | this.id = id; 46 | } 47 | 48 | public Price getPrice() { 49 | return price; 50 | } 51 | 52 | public void setPrice(Price price) { 53 | this.price = price; 54 | } 55 | 56 | public Availability getAvailability() { 57 | return availability; 58 | } 59 | 60 | public void setAvailability(Availability availability) { 61 | this.availability = availability; 62 | } 63 | 64 | public String getIndicator() { 65 | return indicator; 66 | } 67 | 68 | public void setIndicator(String indicator) { 69 | this.indicator = indicator; 70 | } 71 | 72 | public boolean isEnabled() { 73 | return enabled; 74 | } 75 | 76 | public void setEnabled(boolean enabled) { 77 | this.enabled = enabled; 78 | } 79 | 80 | public String getAddByApp() { 81 | return addByApp; 82 | } 83 | 84 | public void setAddByApp(String addByApp) { 85 | this.addByApp = addByApp; 86 | } 87 | 88 | public String getDescription() { 89 | return description; 90 | } 91 | 92 | public void setDescription(String description) { 93 | this.description = description; 94 | } 95 | 96 | public String getCode() { 97 | return code; 98 | } 99 | 100 | public void setCode(String code) { 101 | this.code = code; 102 | } 103 | 104 | public Boolean getExpired() { 105 | return expired; 106 | } 107 | 108 | public void setExpired(Boolean expired) { 109 | this.expired = expired; 110 | } 111 | 112 | public double getSurchargeFee() { 113 | return surchargeFee; 114 | } 115 | 116 | public void setSurchargeFee(double surchargeFee) { 117 | this.surchargeFee = surchargeFee; 118 | } 119 | 120 | public boolean isHistory() { 121 | return history; 122 | } 123 | 124 | public void setHistory(boolean history) { 125 | this.history = history; 126 | } 127 | 128 | public boolean isOrderable() { 129 | return orderable; 130 | } 131 | 132 | public void setOrderable(boolean orderable) { 133 | this.orderable = orderable; 134 | } 135 | 136 | public boolean isBackorderable() { 137 | return backorderable; 138 | } 139 | 140 | public void setBackorderable(boolean backorderable) { 141 | this.backorderable = backorderable; 142 | } 143 | 144 | public Map getAttributes() { 145 | return attributes; 146 | } 147 | 148 | public void setAttributes(Map attributes) { 149 | this.attributes = attributes; 150 | } 151 | 152 | public Boolean getActive() { 153 | return active; 154 | } 155 | 156 | public void setActive(Boolean active) { 157 | this.active = active; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/Resource.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class Resource { 10 | 11 | private Long id; 12 | 13 | private List links = new ArrayList(); 14 | 15 | private String fileName; 16 | 17 | private int height; 18 | 19 | private int width; 20 | 21 | private String text; 22 | 23 | private String description; 24 | 25 | private ResourceType type; 26 | 27 | private List parameters = new ArrayList(); 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public List getLinks() { 38 | return links; 39 | } 40 | 41 | public void setLinks(List links) { 42 | this.links = links; 43 | } 44 | 45 | public String getFileName() { 46 | return fileName; 47 | } 48 | 49 | public void setFileName(String fileName) { 50 | this.fileName = fileName; 51 | } 52 | 53 | public int getHeight() { 54 | return height; 55 | } 56 | 57 | public void setHeight(int height) { 58 | this.height = height; 59 | } 60 | 61 | public int getWidth() { 62 | return width; 63 | } 64 | 65 | public void setWidth(int width) { 66 | this.width = width; 67 | } 68 | 69 | public String getText() { 70 | return text; 71 | } 72 | 73 | public void setText(String text) { 74 | this.text = text; 75 | } 76 | 77 | public String getDescription() { 78 | return description; 79 | } 80 | 81 | public void setDescription(String description) { 82 | this.description = description; 83 | } 84 | 85 | public ResourceType getType() { 86 | return type; 87 | } 88 | 89 | public void setType(ResourceType type) { 90 | this.type = type; 91 | } 92 | 93 | public List getParameters() { 94 | return parameters; 95 | } 96 | 97 | public void setParameters(List parameters) { 98 | this.parameters = parameters; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/ResourceType.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public enum ResourceType { 7 | 8 | IMAGE, 9 | TEXT, 10 | XML, 11 | VIDEO, 12 | WIDGET, 13 | PDF, 14 | EPUB, 15 | JPG 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/source/ShippingRule.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.source; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class ShippingRule { 10 | 11 | private Set returnConstraints; 12 | 13 | private List notes; 14 | 15 | private Boolean giftable; 16 | 17 | private int shipDays; 18 | 19 | public Set getReturnConstraints() { 20 | return returnConstraints; 21 | } 22 | 23 | public void setReturnConstraints(Set returnConstraints) { 24 | this.returnConstraints = returnConstraints; 25 | } 26 | 27 | public List getNotes() { 28 | return notes; 29 | } 30 | 31 | public void setNotes(List notes) { 32 | this.notes = notes; 33 | } 34 | 35 | public Boolean getGiftable() { 36 | return giftable; 37 | } 38 | 39 | public void setGiftable(Boolean giftable) { 40 | this.giftable = giftable; 41 | } 42 | 43 | public int getShipDays() { 44 | return shipDays; 45 | } 46 | 47 | public void setShipDays(int shipDays) { 48 | this.shipDays = shipDays; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Availability.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Availability { 7 | 8 | private boolean available; 9 | 10 | private String source; 11 | 12 | public boolean isAvailable() { 13 | return available; 14 | } 15 | 16 | public void setAvailable(boolean available) { 17 | this.available = available; 18 | } 19 | 20 | public String getSource() { 21 | return source; 22 | } 23 | 24 | public void setSource(String source) { 25 | this.source = source; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Brand.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Brand { 7 | 8 | private String brandName; 9 | 10 | private String rightOwner; 11 | 12 | public String getBrandName() { 13 | return brandName; 14 | } 15 | 16 | public void setBrandName(String brandName) { 17 | this.brandName = brandName; 18 | } 19 | 20 | public String getRightOwner() { 21 | return rightOwner; 22 | } 23 | 24 | public void setRightOwner(String rightOwner) { 25 | this.rightOwner = rightOwner; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Category.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.Collection; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | /** 8 | * @author Anatoliy Sokolenko 9 | */ 10 | public class Category { 11 | 12 | private int id; 13 | 14 | private String categoryName; 15 | 16 | private List products; 17 | 18 | private ShippingRule shipping; 19 | 20 | private String url; 21 | 22 | private boolean visible; 23 | 24 | private String type; 25 | 26 | private boolean hasChildren; 27 | 28 | private List relatedIds; 29 | 30 | private Date from; 31 | 32 | private Integer clearanceStartDays; 33 | 34 | private int position; 35 | 36 | private Boolean countryEligible; 37 | 38 | private boolean isNew; 39 | 40 | private Boolean active; 41 | 42 | private List parameters; 43 | 44 | private String primaryImageSource; 45 | 46 | private String primaryPortraitSource; 47 | 48 | private List availableTo; 49 | 50 | private String author; 51 | 52 | private Date createdAt; 53 | 54 | private Date updatedAt; 55 | 56 | private ParentCategory parentCategory; 57 | 58 | private Collection domainValues; 59 | 60 | private Image primaryImage; 61 | 62 | private List secondaryImages; 63 | 64 | private Brand brand; 65 | 66 | private Double popularity; 67 | 68 | private Integer copies; 69 | 70 | private List resources; 71 | 72 | public Category() { 73 | } 74 | 75 | public int getId() { 76 | return id; 77 | } 78 | 79 | public void setId(int id) { 80 | this.id = id; 81 | } 82 | 83 | public String getCategoryName() { 84 | return categoryName; 85 | } 86 | 87 | public void setCategoryName(String categoryName) { 88 | this.categoryName = categoryName; 89 | } 90 | 91 | public List getProducts() { 92 | return products; 93 | } 94 | 95 | public void setProducts(List products) { 96 | this.products = products; 97 | } 98 | 99 | public ShippingRule getShipping() { 100 | return shipping; 101 | } 102 | 103 | public void setShipping(ShippingRule shipping) { 104 | this.shipping = shipping; 105 | } 106 | 107 | public String getUrl() { 108 | return url; 109 | } 110 | 111 | public void setUrl(String url) { 112 | this.url = url; 113 | } 114 | 115 | public boolean isVisible() { 116 | return visible; 117 | } 118 | 119 | public void setVisible(boolean visible) { 120 | this.visible = visible; 121 | } 122 | 123 | public String getType() { 124 | return type; 125 | } 126 | 127 | public void setType(String type) { 128 | this.type = type; 129 | } 130 | 131 | public boolean isHasChildren() { 132 | return hasChildren; 133 | } 134 | 135 | public void setHasChildren(boolean hasChildren) { 136 | this.hasChildren = hasChildren; 137 | } 138 | 139 | public List getRelatedIds() { 140 | return relatedIds; 141 | } 142 | 143 | public void setRelatedIds(List relatedIds) { 144 | this.relatedIds = relatedIds; 145 | } 146 | 147 | public Date getFrom() { 148 | return from; 149 | } 150 | 151 | public void setFrom(Date from) { 152 | this.from = from; 153 | } 154 | 155 | public Integer getClearanceStartDays() { 156 | return clearanceStartDays; 157 | } 158 | 159 | public void setClearanceStartDays(Integer clearanceStartDays) { 160 | this.clearanceStartDays = clearanceStartDays; 161 | } 162 | 163 | public int getPosition() { 164 | return position; 165 | } 166 | 167 | public void setPosition(int position) { 168 | this.position = position; 169 | } 170 | 171 | public Boolean getCountryEligible() { 172 | return countryEligible; 173 | } 174 | 175 | public void setCountryEligible(Boolean countryEligible) { 176 | this.countryEligible = countryEligible; 177 | } 178 | 179 | public boolean isNew() { 180 | return isNew; 181 | } 182 | 183 | public void setNew(boolean aNew) { 184 | isNew = aNew; 185 | } 186 | 187 | public Boolean getActive() { 188 | return active; 189 | } 190 | 191 | public void setActive(Boolean active) { 192 | this.active = active; 193 | } 194 | 195 | public List getParameters() { 196 | return parameters; 197 | } 198 | 199 | public void setParameters(List parameters) { 200 | this.parameters = parameters; 201 | } 202 | 203 | public String getPrimaryImageSource() { 204 | return primaryImageSource; 205 | } 206 | 207 | public void setPrimaryImageSource(String primaryImageSource) { 208 | this.primaryImageSource = primaryImageSource; 209 | } 210 | 211 | public String getPrimaryPortraitSource() { 212 | return primaryPortraitSource; 213 | } 214 | 215 | public void setPrimaryPortraitSource(String primaryPortraitSource) { 216 | this.primaryPortraitSource = primaryPortraitSource; 217 | } 218 | 219 | public List getAvailableTo() { 220 | return availableTo; 221 | } 222 | 223 | public void setAvailableTo(List availableTo) { 224 | this.availableTo = availableTo; 225 | } 226 | 227 | public String getAuthor() { 228 | return author; 229 | } 230 | 231 | public void setAuthor(String author) { 232 | this.author = author; 233 | } 234 | 235 | public Date getCreatedAt() { 236 | return createdAt; 237 | } 238 | 239 | public void setCreatedAt(Date createdAt) { 240 | this.createdAt = createdAt; 241 | } 242 | 243 | public Date getUpdatedAt() { 244 | return updatedAt; 245 | } 246 | 247 | public void setUpdatedAt(Date updatedAt) { 248 | this.updatedAt = updatedAt; 249 | } 250 | 251 | public ParentCategory getParentCategory() { 252 | return parentCategory; 253 | } 254 | 255 | public void setParentCategory(ParentCategory parentCategory) { 256 | this.parentCategory = parentCategory; 257 | } 258 | 259 | public Collection getDomainValues() { 260 | return domainValues; 261 | } 262 | 263 | public void setDomainValues(Collection domainValues) { 264 | this.domainValues = domainValues; 265 | } 266 | 267 | public Image getPrimaryImage() { 268 | return primaryImage; 269 | } 270 | 271 | public void setPrimaryImage(Image primaryImage) { 272 | this.primaryImage = primaryImage; 273 | } 274 | 275 | public List getSecondaryImages() { 276 | return secondaryImages; 277 | } 278 | 279 | public void setSecondaryImages(List secondaryImages) { 280 | this.secondaryImages = secondaryImages; 281 | } 282 | 283 | public Brand getBrand() { 284 | return brand; 285 | } 286 | 287 | public void setBrand(Brand brandDTO) { 288 | this.brand = brandDTO; 289 | } 290 | 291 | public Double getPopularity() { 292 | return popularity; 293 | } 294 | 295 | public void setPopularity(Double popularity) { 296 | this.popularity = popularity; 297 | } 298 | 299 | public Integer getCopies() { 300 | return copies; 301 | } 302 | 303 | public void setCopies(Integer copies) { 304 | this.copies = copies; 305 | } 306 | 307 | public List getResources() { 308 | return resources; 309 | } 310 | 311 | public void setResources(List resources) { 312 | this.resources = resources; 313 | } 314 | } 315 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Image.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class Image { 7 | 8 | private String name; 9 | 10 | private Integer seq; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | public Integer getSeq() { 21 | return seq; 22 | } 23 | 24 | public void setSeq(Integer seq) { 25 | this.seq = seq; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Link.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class Link { 10 | 11 | private String position; 12 | 13 | private String text; 14 | 15 | private LinkType linkType; 16 | 17 | private String value; 18 | 19 | private List parameters = new ArrayList(); 20 | 21 | public String getPosition() { 22 | return position; 23 | } 24 | 25 | public void setPosition(String position) { 26 | this.position = position; 27 | } 28 | 29 | public String getText() { 30 | return text; 31 | } 32 | 33 | public void setText(String text) { 34 | this.text = text; 35 | } 36 | 37 | public LinkType getLinkType() { 38 | return linkType; 39 | } 40 | 41 | public void setLinkType(LinkType linkType) { 42 | this.linkType = linkType; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | public List getParameters() { 54 | return parameters; 55 | } 56 | 57 | public void setParameters(List parameters) { 58 | this.parameters = parameters; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/LinkType.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public enum LinkType { 7 | 8 | BANNER, COMMERCIAL, PANEL, IMAGE, ICON, LIST 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Parameter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Parameter { 9 | 10 | private String name; 11 | 12 | private List values; 13 | 14 | private int order; 15 | 16 | private boolean hidden; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public List getValues() { 27 | return values; 28 | } 29 | 30 | public void setValues(List values) { 31 | this.values = values; 32 | } 33 | 34 | public int getOrder() { 35 | return order; 36 | } 37 | 38 | public void setOrder(int order) { 39 | this.order = order; 40 | } 41 | 42 | public boolean isHidden() { 43 | return hidden; 44 | } 45 | 46 | public void setHidden(boolean hidden) { 47 | this.hidden = hidden; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/ParentCategory.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public class ParentCategory { 7 | 8 | private int id; 9 | 10 | private String name; 11 | 12 | public ParentCategory() { 13 | } 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public void setId(int id) { 20 | this.id = id; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Price.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Price { 9 | 10 | private double originalPrice; 11 | 12 | private double previousPrice; 13 | 14 | private double retailPrice; 15 | 16 | private double salePrice; 17 | 18 | private Date from; 19 | 20 | private Date to; 21 | 22 | private String description; 23 | 24 | private Boolean onSale; 25 | 26 | public Price() { 27 | } 28 | 29 | public double getOriginalPrice() { 30 | return originalPrice; 31 | } 32 | 33 | public void setOriginalPrice(double originalPrice) { 34 | this.originalPrice = originalPrice; 35 | } 36 | 37 | public double getPreviousPrice() { 38 | return previousPrice; 39 | } 40 | 41 | public void setPreviousPrice(double previousPrice) { 42 | this.previousPrice = previousPrice; 43 | } 44 | 45 | public double getRetailPrice() { 46 | return retailPrice; 47 | } 48 | 49 | public void setRetailPrice(double retailPrice) { 50 | this.retailPrice = retailPrice; 51 | } 52 | 53 | public double getSalePrice() { 54 | return salePrice; 55 | } 56 | 57 | public void setSalePrice(double salePrice) { 58 | this.salePrice = salePrice; 59 | } 60 | 61 | public Date getFrom() { 62 | return from; 63 | } 64 | 65 | public void setFrom(Date from) { 66 | this.from = from; 67 | } 68 | 69 | public Date getTo() { 70 | return to; 71 | } 72 | 73 | public void setTo(Date to) { 74 | this.to = to; 75 | } 76 | 77 | public String getDescription() { 78 | return description; 79 | } 80 | 81 | public void setDescription(String description) { 82 | this.description = description; 83 | } 84 | 85 | public Boolean isOnSale() { 86 | return onSale; 87 | } 88 | 89 | public void setOnSale(Boolean onSale) { 90 | this.onSale = onSale; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Product.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @author Anatoliy Sokolenko 7 | */ 8 | public class Product { 9 | 10 | private Integer id; 11 | 12 | private Price price; 13 | 14 | private Availability availability; 15 | 16 | private String indicator; 17 | 18 | private boolean enabled; 19 | 20 | private String addByApp; 21 | 22 | private String description; 23 | 24 | private String code; 25 | 26 | private Boolean expired; 27 | 28 | private double surchargeFee; 29 | 30 | private boolean history; 31 | 32 | private boolean orderable; 33 | 34 | private boolean backorderable; 35 | 36 | private Map parameters; 37 | 38 | private Boolean active; 39 | 40 | public Integer getId() { 41 | return id; 42 | } 43 | 44 | public void setId(Integer id) { 45 | this.id = id; 46 | } 47 | 48 | public Price getPrice() { 49 | return price; 50 | } 51 | 52 | public void setPrice(Price price) { 53 | this.price = price; 54 | } 55 | 56 | public Availability getAvailability() { 57 | return availability; 58 | } 59 | 60 | public void setAvailability(Availability availability) { 61 | this.availability = availability; 62 | } 63 | 64 | public String getIndicator() { 65 | return indicator; 66 | } 67 | 68 | public void setIndicator(String indicator) { 69 | this.indicator = indicator; 70 | } 71 | 72 | public boolean isEnabled() { 73 | return enabled; 74 | } 75 | 76 | public void setEnabled(boolean enabled) { 77 | this.enabled = enabled; 78 | } 79 | 80 | public String getAddByApp() { 81 | return addByApp; 82 | } 83 | 84 | public void setAddByApp(String addByApp) { 85 | this.addByApp = addByApp; 86 | } 87 | 88 | public String getDescription() { 89 | return description; 90 | } 91 | 92 | public void setDescription(String description) { 93 | this.description = description; 94 | } 95 | 96 | public String getCode() { 97 | return code; 98 | } 99 | 100 | public void setCode(String code) { 101 | this.code = code; 102 | } 103 | 104 | public Boolean getExpired() { 105 | return expired; 106 | } 107 | 108 | public void setExpired(Boolean expired) { 109 | this.expired = expired; 110 | } 111 | 112 | public double getSurchargeFee() { 113 | return surchargeFee; 114 | } 115 | 116 | public void setSurchargeFee(double surchargeFee) { 117 | this.surchargeFee = surchargeFee; 118 | } 119 | 120 | public boolean isHistory() { 121 | return history; 122 | } 123 | 124 | public void setHistory(boolean history) { 125 | this.history = history; 126 | } 127 | 128 | public boolean isOrderable() { 129 | return orderable; 130 | } 131 | 132 | public void setOrderable(boolean orderable) { 133 | this.orderable = orderable; 134 | } 135 | 136 | public boolean isBackorderable() { 137 | return backorderable; 138 | } 139 | 140 | public void setBackorderable(boolean backorderable) { 141 | this.backorderable = backorderable; 142 | } 143 | 144 | public Map getParameters() { 145 | return parameters; 146 | } 147 | 148 | public void setParameters(Map parameters) { 149 | this.parameters = parameters; 150 | } 151 | 152 | public Boolean getActive() { 153 | return active; 154 | } 155 | 156 | public void setActive(Boolean active) { 157 | this.active = active; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/Resource.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class Resource { 10 | 11 | private Long id; 12 | 13 | private List links = new ArrayList(); 14 | 15 | private String fileName; 16 | 17 | private double height; 18 | 19 | private double width; 20 | 21 | private String text; 22 | 23 | private String description; 24 | 25 | private ResourceType type; 26 | 27 | private List parameters = new ArrayList(); 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public List getLinks() { 38 | return links; 39 | } 40 | 41 | public void setLinks(List links) { 42 | this.links = links; 43 | } 44 | 45 | public String getFileName() { 46 | return fileName; 47 | } 48 | 49 | public void setFileName(String fileName) { 50 | this.fileName = fileName; 51 | } 52 | 53 | public double getHeight() { 54 | return height; 55 | } 56 | 57 | public void setHeight(double height) { 58 | this.height = height; 59 | } 60 | 61 | public double getWidth() { 62 | return width; 63 | } 64 | 65 | public void setWidth(double width) { 66 | this.width = width; 67 | } 68 | 69 | public String getText() { 70 | return text; 71 | } 72 | 73 | public void setText(String text) { 74 | this.text = text; 75 | } 76 | 77 | public String getDescription() { 78 | return description; 79 | } 80 | 81 | public void setDescription(String description) { 82 | this.description = description; 83 | } 84 | 85 | public ResourceType getType() { 86 | return type; 87 | } 88 | 89 | public void setType(ResourceType type) { 90 | this.type = type; 91 | } 92 | 93 | public List getParameters() { 94 | return parameters; 95 | } 96 | 97 | public void setParameters(List parameters) { 98 | this.parameters = parameters; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/ResourceType.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | /** 4 | * @author Anatoliy Sokolenko 5 | */ 6 | public enum ResourceType { 7 | 8 | IMAGE, 9 | TEXT, 10 | XML, 11 | VIDEO, 12 | WIDGET, 13 | PDF, 14 | EPUB, 15 | JPG 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/model/target/ShippingRule.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.model.target; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | /** 7 | * @author Anatoliy Sokolenko 8 | */ 9 | public class ShippingRule { 10 | 11 | private Set returnConstraints; 12 | 13 | private List notes; 14 | 15 | private Boolean giftable; 16 | 17 | private int shipDays; 18 | 19 | public Set getReturnConstraints() { 20 | return returnConstraints; 21 | } 22 | 23 | public void setReturnConstraints(Set returnConstraints) { 24 | this.returnConstraints = returnConstraints; 25 | } 26 | 27 | public List getNotes() { 28 | return notes; 29 | } 30 | 31 | public void setNotes(List notes) { 32 | this.notes = notes; 33 | } 34 | 35 | public Boolean getGiftable() { 36 | return giftable; 37 | } 38 | 39 | public void setGiftable(Boolean giftable) { 40 | this.giftable = giftable; 41 | } 42 | 43 | public int getShipDays() { 44 | return shipDays; 45 | } 46 | 47 | public void setShipDays(int shipDays) { 48 | this.shipDays = shipDays; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/me/sokolenko/test/compareConverters/orika/OrikaConverter.java: -------------------------------------------------------------------------------- 1 | package me.sokolenko.test.compareConverters.orika; 2 | 3 | import ma.glasnost.orika.MapperFacade; 4 | import ma.glasnost.orika.MapperFactory; 5 | import ma.glasnost.orika.impl.DefaultMapperFactory; 6 | import me.sokolenko.test.compareConverters.Converter; 7 | import me.sokolenko.test.compareConverters.model.source.Category; 8 | 9 | /** 10 | * @author Anatoliy Sokolenko 11 | */ 12 | public class OrikaConverter implements Converter { 13 | 14 | private final MapperFacade mapper; 15 | 16 | public OrikaConverter() { 17 | MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build(); 18 | 19 | mapperFactory.classMap(Category.class, 20 | me.sokolenko.test.compareConverters.model.target.Category.class) 21 | .field("name", "categoryName") 22 | .byDefault().register(); 23 | 24 | mapper = mapperFactory.getMapperFacade(); 25 | } 26 | 27 | @Override 28 | public me.sokolenko.test.compareConverters.model.target.Category map(Category source) { 29 | return mapper.map(source, me.sokolenko.test.compareConverters.model.target.Category.class); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | #Just disable logging of any library 2 | # Root logger option 3 | log4j.rootLogger=WARN, stdout 4 | 5 | # Direct log messages to stdout 6 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 7 | log4j.appender.stdout.Target=System.out 8 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n -------------------------------------------------------------------------------- /src/main/resources/me/sokolenko/test/compareConverters/dozer/dozer-mapping.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | MM/dd/yyyy HH:mm 10 | true 11 | 12 | 13 | 14 | me.sokolenko.test.compareConverters.model.target.Category 15 | me.sokolenko.test.compareConverters.model.source.Category 16 | 17 | categoryName 18 | name 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------