import org.springframework.data.domain.Pageable;
public class ProductMapper {
public ProductUI toUIBean(Product product) {
ProductUI uiBean = null;
if (product != null) {
uiBean = new ProductUI();
uiBean.setCreateadBy(product.getCreateadBy());
uiBean.setCreatedDate(product.getCreatedDate());
uiBean.setDescription(product.getDescription());
uiBean.setId(product.getId());
uiBean.setModifiedBy(product.getModifiedBy());
uiBean.setModifiedDate(product.getModifiedDate());
uiBean.setPrice(product.getPrice());
if (product.getGroup() != null) {
uiBean.setProductGroup(product.getGroup().getGroupName());
}
uiBean.setProductName(product.getProductName());
}
return uiBean;
}