Resolves checkstyle errors for dao data-bus data-locality data-mapper data-transfer-object decorator (#1067)
* Reduces checkstyle errors in dao * Reduces checkstyle errors in data-bus * Reduces checkstyle errors in data-locality * Reduces checkstyle errors in data-mapper * Reduces checkstyle errors in data-transfer-object * Reduces checkstyle errors in decorator
This commit is contained in:
committed by
Ilkka Seppälä
parent
eae09fc07e
commit
01e489c77b
@ -23,21 +23,20 @@
|
||||
|
||||
package com.iluwatar.datatransfer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The Data Transfer Object pattern is a design pattern in which an data transfer object is used to serve related
|
||||
* information together to avoid multiple call for each piece of information.
|
||||
* <p>
|
||||
* In this example, ({@link CustomerClientApp}) as as customer details consumer i.e. client to request for
|
||||
* customer details to server.
|
||||
* <p>
|
||||
* CustomerResource ({@link CustomerResource}) act as server to serve customer information.
|
||||
* And The CustomerDto ({@link CustomerDto} is data transfer object to share customer information.
|
||||
* The Data Transfer Object pattern is a design pattern in which an data transfer object is used to
|
||||
* serve related information together to avoid multiple call for each piece of information.
|
||||
*
|
||||
* <p>In this example, ({@link CustomerClientApp}) as as customer details consumer i.e. client to
|
||||
* request for customer details to server.
|
||||
*
|
||||
* <p>CustomerResource ({@link CustomerResource}) act as server to serve customer information. And
|
||||
* The CustomerDto ({@link CustomerDto} is data transfer object to share customer information.
|
||||
*/
|
||||
public class CustomerClientApp {
|
||||
|
||||
|
@ -24,10 +24,10 @@
|
||||
package com.iluwatar.datatransfer;
|
||||
|
||||
/**
|
||||
* {@link CustomerDto} is a data transfer object POJO. Instead of sending individual information to client
|
||||
* We can send related information together in POJO.
|
||||
* <p>
|
||||
* Dto will not have any business logic in it.
|
||||
* {@link CustomerDto} is a data transfer object POJO. Instead of sending individual information to
|
||||
* client We can send related information together in POJO.
|
||||
*
|
||||
* <p>Dto will not have any business logic in it.
|
||||
*/
|
||||
public class CustomerDto {
|
||||
private final String id;
|
||||
@ -35,6 +35,8 @@ public class CustomerDto {
|
||||
private final String lastName;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param id customer id
|
||||
* @param firstName customer first name
|
||||
* @param lastName customer last name
|
||||
|
@ -26,13 +26,15 @@ package com.iluwatar.datatransfer;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The resource class which serves customer information.
|
||||
* This class act as server in the demo. Which has all customer details.
|
||||
* The resource class which serves customer information. This class act as server in the demo. Which
|
||||
* has all customer details.
|
||||
*/
|
||||
public class CustomerResource {
|
||||
private List<CustomerDto> customers;
|
||||
|
||||
/**
|
||||
* Initialise resource with existing customers.
|
||||
*
|
||||
* @param customers initialize resource with existing customers. Act as database.
|
||||
*/
|
||||
public CustomerResource(List<CustomerDto> customers) {
|
||||
@ -40,6 +42,8 @@ public class CustomerResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all customers.
|
||||
*
|
||||
* @return : all customers in list.
|
||||
*/
|
||||
public List<CustomerDto> getAllCustomers() {
|
||||
@ -47,6 +51,8 @@ public class CustomerResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new customer.
|
||||
*
|
||||
* @param customer save new customer to list.
|
||||
*/
|
||||
public void save(CustomerDto customer) {
|
||||
@ -54,6 +60,8 @@ public class CustomerResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete customer with given id.
|
||||
*
|
||||
* @param customerId delete customer with id {@code customerId}
|
||||
*/
|
||||
public void delete(String customerId) {
|
||||
|
Reference in New Issue
Block a user