Skip to content

Instantly share code, notes, and snippets.

@sohangp
Created May 15, 2019 18:59
Show Gist options
  • Save sohangp/771168517aff5c9e98089e6acb99a443 to your computer and use it in GitHub Desktop.
Save sohangp/771168517aff5c9e98089e6acb99a443 to your computer and use it in GitHub Desktop.
Another component called for Object creation
@Component
public class MapperUtility {
public CustomerOrderDTO buildOrderDTO(Long orderNumber, Double totalAmount) {
CustomerOrderDTO customerOrderDTO = null;
if (orderNumber != null) {
customerOrderDTO = new CustomerOrderDTO();
customerOrderDTO.setOrderNumber(orderNumber);
customerOrderDTO.setTotalAmount("$" + totalAmount);
}
return customerOrderDTO;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment