class ReadableProductOptionValueMapper implements Mapper<ProductOptionValue, ReadableProductOptionValue> {

  @Autowired
  @Qualifier("img")
  private ImageFilePath imageUtils;

  @Override
  public ReadableProductOptionValue merge(ProductOptionValue source, ReadableProductOptionValue destination,
                                                MerchantStore store, Language language) {<FILL_FUNCTION_BODY>}



  com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription description(ProductOptionValueDescription description) {
    com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription desc = new com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription();
    desc.setDescription(description.getDescription());
    desc.setName(description.getName());
    desc.setId(description.getId());
    desc.setLanguage(description.getLanguage().getCode());
    return desc;
  }


@Override
public ReadableProductOptionValue convert(ProductOptionValue source, MerchantStore store, Language language) {
    ReadableProductOptionValue destination = new ReadableProductOptionValue();
    return merge(source, destination, store, language);
}

}

    ReadableProductOptionValue readableProductOptionValue = new ReadableProductOptionValue();
    if(language == null) {
    	readableProductOptionValue = new ReadableProductOptionValueFull();
      List<com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription> descriptions = new ArrayList<com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription>();
      for(ProductOptionValueDescription desc : source.getDescriptions()) {
          com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription d = this.description(desc);
          descriptions.add(d);
      }
      ((ReadableProductOptionValueFull)readableProductOptionValue).setDescriptions(descriptions);
    } else {
    	readableProductOptionValue = new ReadableProductOptionValue();
      if(!CollectionUtils.isEmpty(source.getDescriptions())) {
        for(ProductOptionValueDescription desc : source.getDescriptions()) {
          if(desc != null && desc.getLanguage()!= null && desc.getLanguage().getId() == language.getId()) {
            com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription d = this.description(desc);
            readableProductOptionValue.setDescription(d);
          }
        }
      }
    }
    
    readableProductOptionValue.setCode(source.getCode());
    if(source.getId()!=null) {
    	readableProductOptionValue.setId(source.getId().longValue());
    }
    if(source.getProductOptionValueSortOrder()!=null) {
    	readableProductOptionValue.setOrder(source.getProductOptionValueSortOrder().intValue());
    }
    if(!StringUtils.isBlank(source.getProductOptionValueImage())) {
    	readableProductOptionValue.setImage(imageUtils.buildProductPropertyImageUtils(store, source.getProductOptionValueImage()));
    }
    
    return readableProductOptionValue;
  
<no_super_class>