<commit_before>package pl.koszela.jan.persistence.dto.impl;

import java.util.ArrayList;
import java.util.List;
import pl.koszela.jan.domain.Product;
import pl.koszela.jan.persistence.dto.ProductDTO;

/**
 * Created on 11.08.2017.
 *
 * @author <NAME>
 */
public class DefaultProductMapper {

  public static ProductDTO map(Product product) {
    DefaultProductDTO dto =  new DefaultProductDTO();
    dto.setId(product.getId());
    dto.setItem(product.getItem());
    dto.setUnitPrice(product.getUnitPrice());
    dto.setCurrency(product.getCurrency());
    dto.setMultipricing(product.isMultipricing());

    return dto;
  }

  public static List<ProductDTO> map(List<Product> products) {
    List<ProductDTO> dtos = new ArrayList<ProductDTO>();

    for (Product product : products) {
      dtos.add(map(product));
    }

    return dtos;
  }

}<commit_msg>Add map method<commit_after>package pl.koszela.jan.persistence.dto.impl;

import java.util.ArrayList;
import java.util.List;
import pl.koszela.jan.domain.impl.Product;
import pl.koszela.jan.persistence.dto.ProductDTO;

/**
 * Created on 11.08.2017.
 *
 * @author <NAME>
 */
public class DefaultProductMapper {

  public static ProductDTO map(Product product) {
    DefaultProductDTO dto =  new DefaultProductDTO();
    dto.setId(product.getId());
    dto.setItem(product.getItem());
    dto.setUnitPrice(product.getUnitPrice());
    dto.setCurrency(product.getCurrency());
    dto.setMultipricing(product.isMultipricing());

    return dto;
  }

  public static Product map(ProductDTO dto) {
    return Product.builder()
        .id(dto.getId())
        .item(dto.getItem())
        .unitPrice(dto.getUnitPrice())
        .currency(dto.getCurrency())
        .multipricing(dto.isMultipricing())
        .build();
  }

  public static List<ProductDTO> map(List<Product> products) {
    List<ProductDTO> dtos = new ArrayList<ProductDTO>();

    for (Product product : products) {
      dtos.add(map(product));
    }

    return dtos;
  }

}
{'fraction_non_alphanumeric': 0.13513513513513514, 'fraction_numerical': 0.008008008008008008, 'mean_word_length': 3.6705607476635516, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1921080', 'n_tokens_mistral': 676, 'n_tokens_neox': 688, 'n_words': 115}