diff --git a/data-transfer-object-enum-impl/README.md b/data-transfer-object-enum-impl/README.md deleted file mode 100644 index 7e6dbc365..000000000 --- a/data-transfer-object-enum-impl/README.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: pattern -title: Data Transfer Object -folder: data-transfer-object -permalink: /patterns/data-transfer-object/ -categories: Architectural -tags: - - Performance ---- - -## Intent - -Pass data with multiple attributes in one shot from client to server, to avoid multiple calls to -remote server. - -## Explanation - -Real world example - -> We need to fetch information about customers from remote database. Instead of querying the -> attributes one at a time, we use DTOs to transfer all the relevant attributes in a single shot. - -In plain words - -> Using DTO relevant information can be fetched with a single backend query. - -Wikipedia says - -> In the field of programming a data transfer object (DTO) is an object that carries data between -> processes. The motivation for its use is that communication between processes is usually done -> resorting to remote interfaces (e.g. web services), where each call is an expensive operation. -> Because the majority of the cost of each call is related to the round-trip time between the client -> and the server, one way of reducing the number of calls is to use an object (the DTO) that -> aggregates the data that would have been transferred by the several calls, but that is served by -> one call only. - -## Class diagram - - - -## Applicability - -Use the Data Transfer Object pattern when: - -* The client is asking for multiple information. And the information is related. -* When you want to boost the performance to get resources. -* You want reduced number of remote calls. - -## Credits - -* [Design Pattern - Transfer Object Pattern](https://www.tutorialspoint.com/design_pattern/transfer_object_pattern.htm) -* [Data Transfer Object](https://msdn.microsoft.com/en-us/library/ff649585.aspx) -* [J2EE Design Patterns](https://www.amazon.com/gp/product/0596004273/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596004273&linkCode=as2&tag=javadesignpat-20&linkId=f27d2644fbe5026ea448791a8ad09c94) -* [Patterns of Enterprise Application Architecture](https://www.amazon.com/gp/product/0321127420/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321127420&linkCode=as2&tag=javadesignpat-20&linkId=014237a67c9d46f384b35e10151956bd) diff --git a/data-transfer-object-enum-impl/etc/data-transfer-object-enum-impl.urm.puml b/data-transfer-object-enum-impl/etc/data-transfer-object-enum-impl.urm.puml deleted file mode 100644 index e6426c392..000000000 --- a/data-transfer-object-enum-impl/etc/data-transfer-object-enum-impl.urm.puml +++ /dev/null @@ -1,129 +0,0 @@ -@startuml -package com.iluwatar.datatransferenum { - class App { - - LOGGER : Logger {static} - + App() - + main(args : String[]) {static} - } - class Product { - - cost : Double - - id : Long - - name : String - - price : Double - - supplier : String - + Product() - + getCost() : Double - + getId() : Long - + getName() : String - + getPrice() : Double - + getSupplier() : String - + setCost(cost : Double) : Product - + setId(id : Long) : Product - + setName(name : String) : Product - + setPrice(price : Double) : Product - + setSupplier(supplier : String) : Product - + toString() : String - } - enum ProductDTO { - + valueOf(name : String) : ProductDTO {static} - + values() : ProductDTO[] {static} - } - -interface Cost { - + getCost() : Double {abstract} - } - -interface Id { - + getId() : Long {abstract} - } - -interface Name { - + getName() : String {abstract} - } - -interface Price { - + getPrice() : Double {abstract} - } - enum Request { - + valueOf(name : String) : Request {static} - + values() : Request[] {static} - } - class Create { - - cost : Double - - name : String - - price : Double - - supplier : String - + Create() - + getCost() : Double - + getName() : String - + getPrice() : Double - + getSupplier() : String - + setCost(cost : Double) : Create - + setName(name : String) : Create - + setPrice(price : Double) : Create - + setSupplier(supplier : String) : Create - } - enum Response { - + valueOf(name : String) : Response {static} - + values() : Response[] {static} - } - class Private { - - cost : Double - - id : Long - - name : String - - price : Double - + Private() - + getCost() : Double - + getId() : Long - + getName() : String - + getPrice() : Double - + setCost(cost : Double) : Private - + setId(id : Long) : Private - + setName(name : String) : Private - + setPrice(price : Double) : Private - + toString() : String - } - class Public { - - id : Long - - name : String - - price : Double - + Public() - + getId() : Long - + getName() : String - + getPrice() : Double - + setId(id : Long) : Public - + setName(name : String) : Public - + setPrice(price : Double) : Public - + toString() : String - } - -interface Supplier { - + getSupplier() : String {abstract} - } - class ProductResource { - - products : List<Product> - + ProductResource(products : List<Product>) - + getAllProductsForAdmin() : List<Private> - + getAllProductsForCustomer() : List<Public> - + getProducts() : List<Product> - + save(createProductDTO : Create) - } -} -Create ..+ Request -Request ..+ ProductDTO -Private ..+ Response -Supplier ..+ ProductDTO -Name ..+ ProductDTO -ProductResource --> "-products" Product -Public ..+ Response -Id ..+ ProductDTO -Price ..+ ProductDTO -Response ..+ ProductDTO -Cost ..+ ProductDTO -Create ..|> Name -Create ..|> Price -Create ..|> Cost -Create ..|> Supplier -Private ..|> Id -Private ..|> Name -Private ..|> Price -Private ..|> Cost -Public ..|> Id -Public ..|> Name -Public ..|> Price -@enduml diff --git a/data-transfer-object-enum-impl/etc/dto-enum-uml.png b/data-transfer-object-enum-impl/etc/dto-enum-uml.png deleted file mode 100644 index 57e9a1ab5..000000000 Binary files a/data-transfer-object-enum-impl/etc/dto-enum-uml.png and /dev/null differ diff --git a/data-transfer-object-enum-impl/pom.xml b/data-transfer-object-enum-impl/pom.xml deleted file mode 100644 index 74c8a3a6c..000000000 --- a/data-transfer-object-enum-impl/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - The MIT License - Copyright © 2014-2019 Ilkka Seppälä - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ---> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>com.iluwatar</groupId> - <artifactId>java-design-patterns</artifactId> - <version>1.24.0-SNAPSHOT</version> - </parent> - <artifactId>data-transfer-object-enum-impl</artifactId> - <dependencies> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <configuration> - <archive> - <manifest> - <mainClass>com.iluwatar.datatransferenum.App</mainClass> - </manifest> - </archive> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/App.java b/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/App.java deleted file mode 100644 index 9c80d07cc..000000000 --- a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/App.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.iluwatar.datatransferenum; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 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 App}) as as product details consumer i.e. client to - * request for product details to server. - * - * <p>productResource ({@link ProductResource}) act as server to serve product information. And - * The productDto ({@link ProductDto} is data transfer object to share product information. - */ -public class App { - - private static final Logger LOGGER = LoggerFactory.getLogger(App.class); - - /** - * Method as act client and request to server for details. - * - * @param args program argument. - */ - public static void main(String[] args) { - Product tv = - new Product().setId(1L).setName("TV").setSupplier("Sony").setPrice(1000D).setCost(1090D); - Product microwave = - new Product().setId(2L).setName("microwave").setSupplier("Delonghi").setPrice(1000D) - .setCost(1090D); - Product refrigerator = - new Product().setId(3L).setName("refrigerator").setSupplier("Botsch").setPrice(1000D) - .setCost(1090D); - Product airConditioner = - new Product().setId(4L).setName("airConditioner").setSupplier("LG").setPrice(1000D) - .setCost(1090D); - List<Product> products = - new ArrayList<>(Arrays.asList(tv, microwave, refrigerator, airConditioner)); - ProductResource productResource = new ProductResource(products); - - LOGGER.info("####### List of products including sensitive data just for admins: \n {}", - Arrays.toString(productResource.getAllProductsForAdmin().toArray())); - LOGGER.info("####### List of products for customers: \n {}", - Arrays.toString(productResource.getAllProductsForCustomer().toArray())); - - LOGGER.info("####### Going to save Sony PS5 ..."); - ProductDto.Request.Create createProductRequestDto = new ProductDto.Request.Create() - .setName("PS5") - .setCost(1000D) - .setPrice(1220D) - .setSupplier("Sony"); - productResource.save(createProductRequestDto); - LOGGER.info("####### List of products after adding PS5: {}", - Arrays.toString(productResource.getProducts().toArray())); - } -} diff --git a/data-transfer-object-enum-impl/src/test/java/com/iluwatar/datatransferenum/AppTest.java b/data-transfer-object-enum-impl/src/test/java/com/iluwatar/datatransferenum/AppTest.java deleted file mode 100644 index bba131e64..000000000 --- a/data-transfer-object-enum-impl/src/test/java/com/iluwatar/datatransferenum/AppTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License - * Copyright © 2014-2019 Ilkka Seppälä - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package com.iluwatar.datatransferenum; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; - - -import org.junit.jupiter.api.Test; - -class AppTest { - - /** - * Issue: Add at least one assertion to this test case. - * <p> - * Solution: Inserted assertion to check whether the execution of the main method in {@link App#main(String[])} - * throws an exception. - */ - - @Test - void shouldExecuteApplicationWithoutException() { - assertDoesNotThrow(() -> App.main(new String[] {})); - } -} diff --git a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/App.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/App.java index b8630d4ea..5bee4e27f 100644 --- a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/App.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/App.java @@ -23,7 +23,13 @@ package com.iluwatar.datatransfer; +import com.iluwatar.datatransfer.customer.CustomerDto; +import com.iluwatar.datatransfer.customer.CustomerResource; +import com.iluwatar.datatransfer.product.Product; +import com.iluwatar.datatransfer.product.ProductDto; +import com.iluwatar.datatransfer.product.ProductResource; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,11 +38,17 @@ import org.slf4j.LoggerFactory; * 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 App}) as as customer details consumer i.e. client to - * request for customer details to server. + * <p>In the first example, {@link App} is a customer details consumer i.e. client to + * request for customer details to server. {@link CustomerResource} act as server to serve customer + * information. {@link CustomerDto} is data transfer object to share customer information. + * + * <p>In the second example, {@link App} is a product details consumer i.e. client to + * request for product details to server. {@link ProductResource} acts as server to serve + * product information. {@link ProductDto} is data transfer object to share product information. + * + * <p>The pattern implementation is a bit different in each of the examples. The first can be + * thought as a traditional example and the second is an enum based implementation. * - * <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 App { @@ -48,6 +60,8 @@ public class App { * @param args program argument. */ public static void main(String[] args) { + + // Example 1: Customer DTO var customerOne = new CustomerDto("1", "Kelly", "Brown"); var customerTwo = new CustomerDto("2", "Alfonso", "Bass"); var customers = new ArrayList<>(List.of(customerOne, customerTwo)); @@ -72,6 +86,53 @@ public class App { customerResource.save(customerThree); allCustomers = customerResource.getAllCustomers(); printCustomerDetails(allCustomers); + + // Example 2: Product DTO + Product tv = + new Product().setId(1L).setName("TV").setSupplier("Sony").setPrice(1000D).setCost(1090D); + Product microwave = + new Product() + .setId(2L) + .setName("microwave") + .setSupplier("Delonghi") + .setPrice(1000D) + .setCost(1090D); + Product refrigerator = + new Product() + .setId(3L) + .setName("refrigerator") + .setSupplier("Botsch") + .setPrice(1000D) + .setCost(1090D); + Product airConditioner = + new Product() + .setId(4L) + .setName("airConditioner") + .setSupplier("LG") + .setPrice(1000D) + .setCost(1090D); + List<Product> products = + new ArrayList<>(Arrays.asList(tv, microwave, refrigerator, airConditioner)); + ProductResource productResource = new ProductResource(products); + + LOGGER.info( + "####### List of products including sensitive data just for admins: \n {}", + Arrays.toString(productResource.getAllProductsForAdmin().toArray())); + LOGGER.info( + "####### List of products for customers: \n {}", + Arrays.toString(productResource.getAllProductsForCustomer().toArray())); + + LOGGER.info("####### Going to save Sony PS5 ..."); + ProductDto.Request.Create createProductRequestDto = + new ProductDto.Request.Create() + .setName("PS5") + .setCost(1000D) + .setPrice(1220D) + .setSupplier("Sony"); + productResource.save(createProductRequestDto); + LOGGER.info( + "####### List of products after adding PS5: {}", + Arrays.toString(productResource.getProducts().toArray())); } private static void printCustomerDetails(List<CustomerDto> allCustomers) { diff --git a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerDto.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerDto.java similarity index 97% rename from data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerDto.java rename to data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerDto.java index a77eb8702..50d3a0857 100644 --- a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerDto.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerDto.java @@ -21,7 +21,7 @@ * THE SOFTWARE. */ -package com.iluwatar.datatransfer; +package com.iluwatar.datatransfer.customer; /** * {@link CustomerDto} is a data transfer object POJO. Instead of sending individual information to diff --git a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerResource.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerResource.java similarity index 98% rename from data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerResource.java rename to data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerResource.java index d0a153f6f..edd3fcb6d 100644 --- a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/CustomerResource.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/customer/CustomerResource.java @@ -21,7 +21,7 @@ * THE SOFTWARE. */ -package com.iluwatar.datatransfer; +package com.iluwatar.datatransfer.customer; import java.util.List; diff --git a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/Product.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/Product.java similarity index 58% rename from data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/Product.java rename to data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/Product.java index 96758baf4..698052efe 100644 --- a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/Product.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/Product.java @@ -1,4 +1,27 @@ -package com.iluwatar.datatransferenum; +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.iluwatar.datatransfer.product; /** * {@link Product} is a entity class for product entity. This class act as entity in the demo. diff --git a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductDto.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductDto.java similarity index 82% rename from data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductDto.java rename to data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductDto.java index 49d08d896..97c2acd05 100644 --- a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductDto.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductDto.java @@ -1,4 +1,27 @@ -package com.iluwatar.datatransferenum; +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.iluwatar.datatransfer.product; /** * {@link ProductDto} is a data transfer object POJO. diff --git a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductResource.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java similarity index 62% rename from data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductResource.java rename to data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java index 5940982b1..abb869254 100644 --- a/data-transfer-object-enum-impl/src/main/java/com/iluwatar/datatransferenum/ProductResource.java +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductResource.java @@ -1,4 +1,27 @@ -package com.iluwatar.datatransferenum; +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.iluwatar.datatransfer.product; import java.util.List; import java.util.stream.Collectors; diff --git a/data-transfer-object/src/test/java/com/iluwatar/datatransfer/CustomerResourceTest.java b/data-transfer-object/src/test/java/com/iluwatar/datatransfer/customer/CustomerResourceTest.java similarity index 94% rename from data-transfer-object/src/test/java/com/iluwatar/datatransfer/CustomerResourceTest.java rename to data-transfer-object/src/test/java/com/iluwatar/datatransfer/customer/CustomerResourceTest.java index 7765fd5bf..8b2d0d92a 100644 --- a/data-transfer-object/src/test/java/com/iluwatar/datatransfer/CustomerResourceTest.java +++ b/data-transfer-object/src/test/java/com/iluwatar/datatransfer/customer/CustomerResourceTest.java @@ -21,13 +21,16 @@ * THE SOFTWARE. */ -package com.iluwatar.datatransfer; +package com.iluwatar.datatransfer.customer; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.List; + +import com.iluwatar.datatransfer.customer.CustomerDto; +import com.iluwatar.datatransfer.customer.CustomerResource; import org.junit.jupiter.api.Test; /** diff --git a/pom.xml b/pom.xml index 38e702761..eee0cb154 100644 --- a/pom.xml +++ b/pom.xml @@ -199,7 +199,6 @@ <module>filterer</module> <module>factory</module> <module>separated-interface</module> - <module>data-transfer-object-enum-impl</module> <module>special-case</module> </modules> diff --git a/registry/pom.xml b/registry/pom.xml index 852bcacfd..bb02f1184 100644 --- a/registry/pom.xml +++ b/registry/pom.xml @@ -1,4 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + + The MIT License + Copyright © 2014-2019 Ilkka Seppälä + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> diff --git a/registry/src/main/java/com/iluwatar/registry/App.java b/registry/src/main/java/com/iluwatar/registry/App.java index a593ce5cc..5dbcf0c05 100644 --- a/registry/src/main/java/com/iluwatar/registry/App.java +++ b/registry/src/main/java/com/iluwatar/registry/App.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.registry; import org.slf4j.Logger; diff --git a/registry/src/main/java/com/iluwatar/registry/Customer.java b/registry/src/main/java/com/iluwatar/registry/Customer.java index 354999fdf..d70407887 100644 --- a/registry/src/main/java/com/iluwatar/registry/Customer.java +++ b/registry/src/main/java/com/iluwatar/registry/Customer.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.registry; public class Customer { diff --git a/registry/src/main/java/com/iluwatar/registry/CustomerRegistry.java b/registry/src/main/java/com/iluwatar/registry/CustomerRegistry.java index 406d616c6..62453d425 100644 --- a/registry/src/main/java/com/iluwatar/registry/CustomerRegistry.java +++ b/registry/src/main/java/com/iluwatar/registry/CustomerRegistry.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.registry; import java.util.Map; diff --git a/registry/src/test/java/com/iluwatar/registry/CustomerRegistryTest.java b/registry/src/test/java/com/iluwatar/registry/CustomerRegistryTest.java index 2919390b9..3a23eec2f 100644 --- a/registry/src/test/java/com/iluwatar/registry/CustomerRegistryTest.java +++ b/registry/src/test/java/com/iluwatar/registry/CustomerRegistryTest.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.registry; import org.junit.jupiter.api.BeforeAll; diff --git a/special-case/pom.xml b/special-case/pom.xml index c62b9e759..a0ce1b46b 100644 --- a/special-case/pom.xml +++ b/special-case/pom.xml @@ -1,4 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + + The MIT License + Copyright © 2014-2019 Ilkka Seppälä + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> diff --git a/special-case/src/main/java/com/iluwatar/specialcase/App.java b/special-case/src/main/java/com/iluwatar/specialcase/App.java index 276b1dd85..f7245da37 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/App.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/App.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServices.java b/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServices.java index f756ccc43..9ad2de619 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServices.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServices.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public interface ApplicationServices { diff --git a/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServicesImpl.java b/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServicesImpl.java index ebb9109bc..43b123673 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServicesImpl.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/ApplicationServicesImpl.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public class ApplicationServicesImpl implements ApplicationServices { diff --git a/special-case/src/main/java/com/iluwatar/specialcase/Db.java b/special-case/src/main/java/com/iluwatar/specialcase/Db.java index 847330ece..7696e9865 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/Db.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/Db.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import java.util.HashMap; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/DomainServices.java b/special-case/src/main/java/com/iluwatar/specialcase/DomainServices.java index a052eb20b..fadd40278 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/DomainServices.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/DomainServices.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public interface DomainServices { diff --git a/special-case/src/main/java/com/iluwatar/specialcase/DomainServicesImpl.java b/special-case/src/main/java/com/iluwatar/specialcase/DomainServicesImpl.java index 400689ed9..a9e40ba7a 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/DomainServicesImpl.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/DomainServicesImpl.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public class DomainServicesImpl implements DomainServices { diff --git a/special-case/src/main/java/com/iluwatar/specialcase/DownForMaintenance.java b/special-case/src/main/java/com/iluwatar/specialcase/DownForMaintenance.java index 98a2cf89c..9076202b5 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/DownForMaintenance.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/DownForMaintenance.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/InsufficientFunds.java b/special-case/src/main/java/com/iluwatar/specialcase/InsufficientFunds.java index 8fe714f80..4bf5af883 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/InsufficientFunds.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/InsufficientFunds.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/InvalidUser.java b/special-case/src/main/java/com/iluwatar/specialcase/InvalidUser.java index 443fdc7bf..4accfaa42 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/InvalidUser.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/InvalidUser.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/MaintenanceLock.java b/special-case/src/main/java/com/iluwatar/specialcase/MaintenanceLock.java index 29a5b4f81..ffe0c2628 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/MaintenanceLock.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/MaintenanceLock.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/MoneyTransaction.java b/special-case/src/main/java/com/iluwatar/specialcase/MoneyTransaction.java index e3904964f..8ed509f62 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/MoneyTransaction.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/MoneyTransaction.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public class MoneyTransaction { diff --git a/special-case/src/main/java/com/iluwatar/specialcase/OutOfStock.java b/special-case/src/main/java/com/iluwatar/specialcase/OutOfStock.java index 5359bed31..a06eb4360 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/OutOfStock.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/OutOfStock.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/ReceiptDto.java b/special-case/src/main/java/com/iluwatar/specialcase/ReceiptDto.java index 81fc46bbe..5323f7190 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/ReceiptDto.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/ReceiptDto.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import org.slf4j.Logger; diff --git a/special-case/src/main/java/com/iluwatar/specialcase/ReceiptViewModel.java b/special-case/src/main/java/com/iluwatar/specialcase/ReceiptViewModel.java index 482eef21f..fd9b42cad 100644 --- a/special-case/src/main/java/com/iluwatar/specialcase/ReceiptViewModel.java +++ b/special-case/src/main/java/com/iluwatar/specialcase/ReceiptViewModel.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; public interface ReceiptViewModel { diff --git a/special-case/src/test/java/com/iluwatar/specialcase/AppTest.java b/special-case/src/test/java/com/iluwatar/specialcase/AppTest.java index 25799368b..1c33e0513 100644 --- a/special-case/src/test/java/com/iluwatar/specialcase/AppTest.java +++ b/special-case/src/test/java/com/iluwatar/specialcase/AppTest.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; diff --git a/special-case/src/test/java/com/iluwatar/specialcase/SpecialCasesTest.java b/special-case/src/test/java/com/iluwatar/specialcase/SpecialCasesTest.java index 5e83aa8d6..573afe0a2 100644 --- a/special-case/src/test/java/com/iluwatar/specialcase/SpecialCasesTest.java +++ b/special-case/src/test/java/com/iluwatar/specialcase/SpecialCasesTest.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.specialcase; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/strategy/src/main/java/com/iluwatar/strategy/LambdaStrategy.java b/strategy/src/main/java/com/iluwatar/strategy/LambdaStrategy.java index d74806017..042f6e7cc 100644 --- a/strategy/src/main/java/com/iluwatar/strategy/LambdaStrategy.java +++ b/strategy/src/main/java/com/iluwatar/strategy/LambdaStrategy.java @@ -1,3 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package com.iluwatar.strategy; import org.slf4j.Logger;