Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4904d7e
#1021: Fix checkstyle warnings by changing the license header templat…
vanogrid Oct 22, 2019
acaa6cd
local variable type inference changes (#1028)
gvsharma Oct 23, 2019
1b6cecd
Update keywords
iluwatar Oct 24, 2019
1cb1bdc
https://github.com/iluwatar/java-design-patterns/issues/1009 - remove…
akrystian Oct 25, 2019
6aeafcf
https://github.com/iluwatar/java-design-patterns/issues/1016 - decrea…
akrystian Oct 26, 2019
70ddeaa
Create FUNDING.yml
iluwatar Oct 26, 2019
f7a53f2
service-layer local type inference changes (#1034)
gvsharma Oct 26, 2019
58d8fa1
local variable type inference changes (#1035)
gvsharma Oct 26, 2019
0b8d78e
local variable type inference changes (#1036)
gvsharma Oct 26, 2019
12f13a6
local variable infere changes (#1038)
gvsharma Oct 26, 2019
349d8ed
local variable type inference changes (#1039)
gvsharma Oct 26, 2019
af8c5ed
local variable type inference changes (#1040)
gvsharma Oct 26, 2019
03e1e92
local variable type inference changes (#1041)
gvsharma Oct 26, 2019
954e730
local variable type inference changes (#1043)
gvsharma Oct 26, 2019
c7fee7b
local variable type inference changes (#1042)
gvsharma Oct 26, 2019
fadad43
#984 for unitofwork, tolerantreader, twin (#1044)
Anurag870 Oct 26, 2019
d01a3a6
Update Github token
iluwatar Oct 26, 2019
5d47488
Fix error when building from a submodule directory (#1045)
vanogrid Oct 26, 2019
d1767bb
The pattern Role object (#1031)
besok Oct 26, 2019
9f7e3fe
Update license headers
iluwatar Oct 26, 2019
b50189e
Fix Role Object front matter
iluwatar Oct 26, 2019
63fb8dc
Add java 11 (#1048)
leonmak Oct 27, 2019
6bb3438
Add java 11 (#1049)
leonmak Oct 27, 2019
dd971d8
Use java 11 (#1050)
leonmak Oct 28, 2019
c8a481b
Add java 11 support for #987 (o-t) (#1051)
leonmak Oct 29, 2019
a65a601
Update web site logic
iluwatar Oct 29, 2019
ccc1a63
Update script
iluwatar Oct 29, 2019
ff52848
Update script
iluwatar Oct 29, 2019
91a085d
Update script
iluwatar Oct 30, 2019
fca7e9c
https://github.com/iluwatar/java-design-patterns/issues/1021 - decrea…
akrystian Oct 30, 2019
a9dfd7e
Update license header
iluwatar Oct 30, 2019
cdb80b8
Issue 893 (#1014)
hbothra15 Oct 30, 2019
cc85c73
Move faq.md to java-design-patterns-web repository
iluwatar Oct 30, 2019
1eb1961
Remove presentations
iluwatar Oct 30, 2019
3b1a281
decrease number of checkstyle errors in singleton, strategy and visit…
leonorader Oct 31, 2019
55b0341
Fix remaining Checkstyle errors for Singleton
iluwatar Oct 31, 2019
1d4a768
Fix for Issue #549 : Add Fallbacks in Aggregator Service (#971)
jarpit96 Nov 1, 2019
a8c7771
#1021 style changes for Specification
iluwatar Nov 1, 2019
bfd990a
Create sharding module
Azureyjt Nov 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [iluwatar]
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ sudo: required

env:
global:
- GH_REF: github.com/iluwatar/java-design-patterns.git
- secure: LxTDuNS/rBWIvKkaEqr79ImZAe48mCdoYCF41coxNXgNoippo4GIBArknqtv+XvdkiuRZ1yGyj6pn8GU33c/yn+krddTUkVCwTbVatbalW5jhQjDbHYym/JcxaK9ZS/3JTeGcWrBgiPqHEEDhCf26vPZsXoMSeVCEORVKTp1BSg=
- secure: "DCpazS3nkLnter3sguXEAS2fC/1ZWNfM+XLyif9MfNFxlZdpni2vCD/jA0Rdpga8puQWHNVLyAec+RPFH/2qSmJ1c1UTV5MaLv8tPqwUX0VFA+1I6XoSv6oX4ldHTBWHEWqQHkRFOLoil0h0edc0tTOWQwXF8U+DLAB+HkRb4gw="

services:
- xvfb
Expand All @@ -24,7 +23,7 @@ script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn clean verify sonar:sonar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.host.url=https://sonarcloud.io; fi'

after_success:
- bash update-ghpages.sh
- bash update-website.sh

notifications:
email:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,16 +20,16 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;

import java.util.Arrays;
import java.util.HashMap;
package com.iluwatar.abstractdocument;

import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.enums.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.List;
import java.util.Map;

/**
* The Abstract Document pattern enables handling additional, non-static
Expand All @@ -51,21 +51,20 @@ public class App {
public App() {
LOGGER.info("Constructing parts and car");

var carProperties = new HashMap<String, Object>();
carProperties.put(Property.MODEL.toString(), "300SL");
carProperties.put(Property.PRICE.toString(), 10000L);

var wheelProperties = new HashMap<String, Object>();
wheelProperties.put(Property.TYPE.toString(), "wheel");
wheelProperties.put(Property.MODEL.toString(), "15C");
wheelProperties.put(Property.PRICE.toString(), 100L);
var wheelProperties = Map.of(
Property.TYPE.toString(), "wheel",
Property.MODEL.toString(), "15C",
Property.PRICE.toString(), 100L);

var doorProperties = new HashMap<String, Object>();
doorProperties.put(Property.TYPE.toString(), "door");
doorProperties.put(Property.MODEL.toString(), "Lambo");
doorProperties.put(Property.PRICE.toString(), 300L);
var doorProperties = Map.of(
Property.TYPE.toString(), "door",
Property.MODEL.toString(), "Lambo",
Property.PRICE.toString(), 300L);

carProperties.put(Property.PARTS.toString(), Arrays.asList(wheelProperties, doorProperties));
var carProperties = Map.of(
Property.MODEL.toString(), "300SL",
Property.PRICE.toString(), 10000L,
Property.PARTS.toString(), List.of(wheelProperties, doorProperties));

var car = new Car(carProperties);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.stream.Stream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain.enums;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,19 +20,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;

/**
* AbstractDocument test class
Expand All @@ -59,9 +57,7 @@ public void shouldPutAndGetValue() {

@Test
public void shouldRetrieveChildren() {
Map<String, Object> child1 = new HashMap<>();
Map<String, Object> child2 = new HashMap<>();
List<Map<String, Object>> children = Arrays.asList(child1, child2);
var children = List.of(Map.of(), Map.of());

document.put(KEY, children);

Expand All @@ -79,8 +75,7 @@ public void shouldRetrieveEmptyStreamForNonExistingChildren() {

@Test
public void shouldIncludePropsInToString() {
Map<String, Object> props = new HashMap<>();
props.put(KEY, VALUE);
Map<String, Object> props = Map.of(KEY, VALUE);
DocumentImplementation document = new DocumentImplementation(props);
assertTrue(document.toString().contains(KEY));
assertTrue(document.toString().contains(VALUE));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* The MIT License
* Copyright © 2014-2019 Ilkka Seppälä
*
Expand All @@ -20,19 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.junit.jupiter.api.Test;
package com.iluwatar.abstractdocument;

import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.Part;
import com.iluwatar.abstractdocument.domain.enums.Property;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* Test for Part and Car
Expand All @@ -48,10 +47,10 @@ public class DomainTest {

@Test
public void shouldConstructPart() {
Map<String, Object> partProperties = new HashMap<>();
partProperties.put(Property.TYPE.toString(), TEST_PART_TYPE);
partProperties.put(Property.MODEL.toString(), TEST_PART_MODEL);
partProperties.put(Property.PRICE.toString(), TEST_PART_PRICE);
Map<String, Object> partProperties = Map.of(
Property.TYPE.toString(), TEST_PART_TYPE,
Property.MODEL.toString(), TEST_PART_MODEL,
Property.PRICE.toString(), TEST_PART_PRICE);
Part part = new Part(partProperties);

assertEquals(TEST_PART_TYPE, part.getType().get());
Expand All @@ -61,10 +60,10 @@ public void shouldConstructPart() {

@Test
public void shouldConstructCar() {
Map<String, Object> carProperties = new HashMap<>();
carProperties.put(Property.MODEL.toString(), TEST_CAR_MODEL);
carProperties.put(Property.PRICE.toString(), TEST_CAR_PRICE);
carProperties.put(Property.PARTS.toString(), Arrays.asList(new HashMap<>(), new HashMap<>()));
Map<String, Object> carProperties = Map.of(
Property.MODEL.toString(), TEST_CAR_MODEL,
Property.PRICE.toString(), TEST_CAR_PRICE,
Property.PARTS.toString(), List.of(Map.of(), Map.of()));
Car car = new Car(carProperties);

assertEquals(TEST_CAR_MODEL, car.getModel().get());
Expand Down
4 changes: 0 additions & 4 deletions abstract-factory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ Use the Abstract Factory pattern when
## Tutorial
* [Abstract Factory Pattern Tutorial](https://www.journaldev.com/1418/abstract-factory-design-pattern-in-java)

## Presentations

* [Abstract Factory Pattern](etc/presentation.html)


## Real world examples

Expand Down
Binary file removed abstract-factory/etc/diagram1.png
Binary file not shown.
Binary file removed abstract-factory/etc/diagram2.png
Binary file not shown.
Loading