Compare commits

..

3 Commits

Author SHA1 Message Date
637cf61e40 Merge branch 'master' into all-contributors/add-oconnelc
# Conflicts:
#	.all-contributorsrc
#	README.md
2020-07-29 18:06:34 +03:00
26a3be290b docs: update .all-contributorsrc [skip ci] 2020-07-28 16:52:55 +00:00
f7846cefa9 docs: update README.md [skip ci] 2020-07-28 16:52:54 +00:00
251 changed files with 1201 additions and 2034 deletions

View File

@ -291,438 +291,6 @@
"code" "code"
] ]
}, },
{
"login": "IAmPramod",
"name": "Pramod Gupta",
"avatar_url": "https://avatars1.githubusercontent.com/u/2184241?v=4",
"profile": "https://www.linkedin.com/in/pramodgupta3/",
"contributions": [
"review"
]
},
{
"login": "Amarnath510",
"name": "Amarnath Chandana",
"avatar_url": "https://avatars0.githubusercontent.com/u/4599623?v=4",
"profile": "https://amarnath510.github.io/portfolio",
"contributions": [
"code"
]
},
{
"login": "Anurag870",
"name": "Anurag870",
"avatar_url": "https://avatars1.githubusercontent.com/u/6295975?v=4",
"profile": "https://github.com/Anurag870",
"contributions": [
"code"
]
},
{
"login": "Deathnerd",
"name": "Wes Gilleland",
"avatar_url": "https://avatars0.githubusercontent.com/u/1685953?v=4",
"profile": "http://theerroris.me",
"contributions": [
"code"
]
},
{
"login": "Harshrajsinh",
"name": "Harshraj Thakor",
"avatar_url": "https://avatars2.githubusercontent.com/u/22811531?v=4",
"profile": "https://github.com/Harshrajsinh",
"contributions": [
"code"
]
},
{
"login": "MaVdbussche",
"name": "Martin Vandenbussche",
"avatar_url": "https://avatars1.githubusercontent.com/u/26136934?v=4",
"profile": "https://github.com/MaVdbussche",
"contributions": [
"code"
]
},
{
"login": "alexsomai",
"name": "Alexandru Somai",
"avatar_url": "https://avatars1.githubusercontent.com/u/5720977?v=4",
"profile": "https://alexsomai.com",
"contributions": [
"code"
]
},
{
"login": "amogozov",
"name": "Artur Mogozov",
"avatar_url": "https://avatars3.githubusercontent.com/u/7372215?v=4",
"profile": "https://github.com/amogozov",
"contributions": [
"code"
]
},
{
"login": "anthonycampbell",
"name": "anthony",
"avatar_url": "https://avatars3.githubusercontent.com/u/10249255?v=4",
"profile": "https://github.com/anthonycampbell",
"contributions": [
"code"
]
},
{
"login": "christophercolumbusdog",
"name": "Christian Cygnus",
"avatar_url": "https://avatars1.githubusercontent.com/u/9342724?v=4",
"profile": "http://ccygnus.com/",
"contributions": [
"code"
]
},
{
"login": "dzmitryh",
"name": "Dima Gubin",
"avatar_url": "https://avatars2.githubusercontent.com/u/5390492?v=4",
"profile": "https://about.me/dzmitryh",
"contributions": [
"code"
]
},
{
"login": "jjjimenez100",
"name": "Joshua Jimenez",
"avatar_url": "https://avatars3.githubusercontent.com/u/22243493?v=4",
"profile": "https://github.com/jjjimenez100",
"contributions": [
"code"
]
},
{
"login": "kaiwinter",
"name": "Kai Winter",
"avatar_url": "https://avatars0.githubusercontent.com/u/110982?v=4",
"profile": "http://about.me/kaiwinter",
"contributions": [
"code"
]
},
{
"login": "lbroman",
"name": "lbroman",
"avatar_url": "https://avatars1.githubusercontent.com/u/86007?v=4",
"profile": "https://github.com/lbroman",
"contributions": [
"code"
]
},
{
"login": "pnowy",
"name": "Przemek",
"avatar_url": "https://avatars1.githubusercontent.com/u/3254609?v=4",
"profile": "https://przemeknowak.com",
"contributions": [
"code"
]
},
{
"login": "prafful1",
"name": "Prafful Agarwal",
"avatar_url": "https://avatars0.githubusercontent.com/u/14350274?v=4",
"profile": "https://github.com/prafful1",
"contributions": [
"content"
]
},
{
"login": "sankypanhale",
"name": "Sanket Panhale",
"avatar_url": "https://avatars1.githubusercontent.com/u/6478783?v=4",
"profile": "https://github.com/sankypanhale",
"contributions": [
"content"
]
},
{
"login": "staillebois",
"name": "staillebois",
"avatar_url": "https://avatars0.githubusercontent.com/u/23701200?v=4",
"profile": "https://github.com/staillebois",
"contributions": [
"code"
]
},
{
"login": "valdar-hu",
"name": "Krisztián Nagy",
"avatar_url": "https://avatars3.githubusercontent.com/u/17962817?v=4",
"profile": "https://github.com/valdar-hu",
"contributions": [
"code"
]
},
{
"login": "vanogrid",
"name": "Alexander Ivanov",
"avatar_url": "https://avatars0.githubusercontent.com/u/4307918?v=4",
"profile": "https://www.vanogrid.com",
"contributions": [
"code"
]
},
{
"login": "yosfik",
"name": "Yosfik Alqadri",
"avatar_url": "https://avatars3.githubusercontent.com/u/4850270?v=4",
"profile": "https://github.com/yosfik",
"contributions": [
"code"
]
},
{
"login": "7agustibm",
"name": "Agustí Becerra Milà",
"avatar_url": "https://avatars0.githubusercontent.com/u/8149332?v=4",
"profile": "https://github.com/7agustibm",
"contributions": [
"code"
]
},
{
"login": "Juaanma",
"name": "Juan Manuel Suárez",
"avatar_url": "https://avatars3.githubusercontent.com/u/7390500?v=4",
"profile": "https://github.com/Juaanma",
"contributions": [
"code"
]
},
{
"login": "LuigiCortese",
"name": "Luigi Cortese",
"avatar_url": "https://avatars0.githubusercontent.com/u/9956006?v=4",
"profile": "http://www.devsedge.net/",
"contributions": [
"code"
]
},
{
"login": "Rzeposlaw",
"name": "Katarzyna Rzepecka",
"avatar_url": "https://avatars2.githubusercontent.com/u/18425745?v=4",
"profile": "https://github.com/Rzeposlaw",
"contributions": [
"code"
]
},
{
"login": "akrystian",
"name": "adamski.pro",
"avatar_url": "https://avatars1.githubusercontent.com/u/6537430?v=4",
"profile": "http://adamski.pro",
"contributions": [
"code"
]
},
{
"login": "baislsl",
"name": "Shengli Bai",
"avatar_url": "https://avatars0.githubusercontent.com/u/17060584?v=4",
"profile": "https://github.com/baislsl",
"contributions": [
"code"
]
},
{
"login": "besok",
"name": "Boris",
"avatar_url": "https://avatars2.githubusercontent.com/u/29834592?v=4",
"profile": "https://github.com/besok",
"contributions": [
"code"
]
},
{
"login": "dmitraver",
"name": "Dmitry Avershin",
"avatar_url": "https://avatars3.githubusercontent.com/u/1798156?v=4",
"profile": "https://github.com/dmitraver",
"contributions": [
"code"
]
},
{
"login": "fanofxiaofeng",
"name": "靳阳",
"avatar_url": "https://avatars0.githubusercontent.com/u/3983683?v=4",
"profile": "https://github.com/fanofxiaofeng",
"contributions": [
"code"
]
},
{
"login": "hoangnam2261",
"name": "hoangnam2261",
"avatar_url": "https://avatars2.githubusercontent.com/u/31692990?v=4",
"profile": "https://github.com/hoangnam2261",
"contributions": [
"code"
]
},
{
"login": "jarpit96",
"name": "Arpit Jain",
"avatar_url": "https://avatars2.githubusercontent.com/u/10098713?v=4",
"profile": "https://github.com/jarpit96",
"contributions": [
"code"
]
},
{
"login": "joningiwork",
"name": "Jón Ingi Sveinbjörnsson",
"avatar_url": "https://avatars2.githubusercontent.com/u/6115148?v=4",
"profile": "http://joningi.net",
"contributions": [
"code"
]
},
{
"login": "kirill-vlasov",
"name": "Kirill Vlasov",
"avatar_url": "https://avatars3.githubusercontent.com/u/16112495?v=4",
"profile": "https://github.com/kirill-vlasov",
"contributions": [
"code"
]
},
{
"login": "mitchellirvin",
"name": "Mitchell Irvin",
"avatar_url": "https://avatars0.githubusercontent.com/u/16233245?v=4",
"profile": "http://mitchell-irvin.com",
"contributions": [
"code"
]
},
{
"login": "ranjeet-floyd",
"name": "Ranjeet",
"avatar_url": "https://avatars0.githubusercontent.com/u/1992972?v=4",
"profile": "https://ranjeet-floyd.github.io",
"contributions": [
"code"
]
},
{
"login": "Alwayswithme",
"name": "PhoenixYip",
"avatar_url": "https://avatars3.githubusercontent.com/u/3234786?v=4",
"profile": "https://alwayswithme.github.io",
"contributions": [
"code"
]
},
{
"login": "MSaifAsif",
"name": "M Saif Asif",
"avatar_url": "https://avatars1.githubusercontent.com/u/6280554?v=4",
"profile": "https://github.com/MSaifAsif",
"contributions": [
"code"
]
},
{
"login": "kanwarpreet25",
"name": "kanwarpreet25",
"avatar_url": "https://avatars0.githubusercontent.com/u/39183641?v=4",
"profile": "https://github.com/kanwarpreet25",
"contributions": [
"code"
]
},
{
"login": "leonmak",
"name": "Leon Mak",
"avatar_url": "https://avatars3.githubusercontent.com/u/13071508?v=4",
"profile": "http://leonmak.me",
"contributions": [
"code"
]
},
{
"login": "perwramdemark",
"name": "Per Wramdemark",
"avatar_url": "https://avatars2.githubusercontent.com/u/7052193?v=4",
"profile": "http://www.wramdemark.se",
"contributions": [
"code"
]
},
{
"login": "waisuan",
"name": "Evan Sia Wai Suan",
"avatar_url": "https://avatars2.githubusercontent.com/u/10975700?v=4",
"profile": "https://github.com/waisuan",
"contributions": [
"code"
]
},
{
"login": "AnaghaSasikumar",
"name": "AnaghaSasikumar",
"avatar_url": "https://avatars2.githubusercontent.com/u/42939261?v=4",
"profile": "https://github.com/AnaghaSasikumar",
"contributions": [
"code"
]
},
{
"login": "christofferh",
"name": "Christoffer Hamberg",
"avatar_url": "https://avatars1.githubusercontent.com/u/767643?v=4",
"profile": "https://christofferh.com",
"contributions": [
"code"
]
},
{
"login": "dgruntz",
"name": "Dominik Gruntz",
"avatar_url": "https://avatars0.githubusercontent.com/u/1516800?v=4",
"profile": "https://github.com/dgruntz",
"contributions": [
"code"
]
},
{
"login": "hannespernpeintner",
"name": "Hannes",
"avatar_url": "https://avatars3.githubusercontent.com/u/1679437?v=4",
"profile": "https://bitbucket.org/hannespernpeintner/",
"contributions": [
"code"
]
},
{
"login": "leogtzr",
"name": "Leo Gutiérrez Ramírez",
"avatar_url": "https://avatars0.githubusercontent.com/u/1211969?v=4",
"profile": "https://github.com/leogtzr",
"contributions": [
"code"
]
},
{
"login": "npczwh",
"name": "Zhang WH",
"avatar_url": "https://avatars0.githubusercontent.com/u/14066422?v=4",
"profile": "https://github.com/npczwh",
"contributions": [
"code"
]
},
{ {
"login": "oconnelc", "login": "oconnelc",
"name": "Christopher O'Connell", "name": "Christopher O'Connell",
@ -747,8 +315,7 @@
"avatar_url": "https://avatars1.githubusercontent.com/u/7418012?v=4", "avatar_url": "https://avatars1.githubusercontent.com/u/7418012?v=4",
"profile": "https://github.com/hbothra15", "profile": "https://github.com/hbothra15",
"contributions": [ "contributions": [
"code", "code"
"design"
] ]
}, },
{ {
@ -903,159 +470,6 @@
"contributions": [ "contributions": [
"code" "code"
] ]
},
{
"login": "trautonen",
"name": "Tapio Rautonen",
"avatar_url": "https://avatars3.githubusercontent.com/u/1641063?v=4",
"profile": "https://github.com/trautonen",
"contributions": [
"code"
]
},
{
"login": "yorlov",
"name": "Yuri Orlov",
"avatar_url": "https://avatars0.githubusercontent.com/u/1595733?v=4",
"profile": "http://vk.com/yuri.orlov",
"contributions": [
"code"
]
},
{
"login": "varunu28",
"name": "Varun Upadhyay",
"avatar_url": "https://avatars0.githubusercontent.com/u/7676016?v=4",
"profile": "https://www.linkedin.com/in/varunu28/",
"contributions": [
"code"
]
},
{
"login": "PalAditya",
"name": "Aditya Pal",
"avatar_url": "https://avatars2.githubusercontent.com/u/25523604?v=4",
"profile": "https://github.com/PalAditya",
"contributions": [
"code"
]
},
{
"login": "grzesiekkedzior",
"name": "grzesiekkedzior",
"avatar_url": "https://avatars3.githubusercontent.com/u/23739158?v=4",
"profile": "https://github.com/grzesiekkedzior",
"contributions": [
"code"
]
},
{
"login": "sivasubramanim",
"name": "Sivasubramani M",
"avatar_url": "https://avatars2.githubusercontent.com/u/51107434?v=4",
"profile": "https://github.com/sivasubramanim",
"contributions": [
"code"
]
},
{
"login": "d4gg4d",
"name": "Sami Airaksinen",
"avatar_url": "https://avatars2.githubusercontent.com/u/99457?v=4",
"profile": "https://github.com/d4gg4d",
"contributions": [
"code"
]
},
{
"login": "vertti",
"name": "Janne Sinivirta",
"avatar_url": "https://avatars0.githubusercontent.com/u/557751?v=4",
"profile": "https://github.com/vertti",
"contributions": [
"code"
]
},
{
"login": "Bobo1239",
"name": "Boris-Chengbiao Zhou",
"avatar_url": "https://avatars1.githubusercontent.com/u/2302947?v=4",
"profile": "https://github.com/Bobo1239",
"contributions": [
"content"
]
},
{
"login": "Jahhein",
"name": "Jacob Hein",
"avatar_url": "https://avatars2.githubusercontent.com/u/10779515?v=4",
"profile": "https://jahhein.github.io",
"contributions": [
"content"
]
},
{
"login": "iamrichardjones",
"name": "Richard Jones",
"avatar_url": "https://avatars3.githubusercontent.com/u/14842151?v=4",
"profile": "https://github.com/iamrichardjones",
"contributions": [
"content"
]
},
{
"login": "rachelcarmena",
"name": "Rachel M. Carmena",
"avatar_url": "https://avatars0.githubusercontent.com/u/22792183?v=4",
"profile": "https://rachelcarmena.github.io",
"contributions": [
"content"
]
},
{
"login": "zd-zero",
"name": "Zaerald Denze Lungos",
"avatar_url": "https://avatars0.githubusercontent.com/u/21978370?v=4",
"profile": "https://zd-zero.github.io",
"contributions": [
"content"
]
},
{
"login": "webpro",
"name": "Lars Kappert",
"avatar_url": "https://avatars1.githubusercontent.com/u/456426?v=4",
"profile": "https://webpro.nl",
"contributions": [
"content"
]
},
{
"login": "xiaod-dev",
"name": "Mike Liu",
"avatar_url": "https://avatars2.githubusercontent.com/u/21277644?v=4",
"profile": "https://xiaod.info",
"contributions": [
"translation"
]
},
{
"login": "charlesfinley",
"name": "Matt Dolan",
"avatar_url": "https://avatars1.githubusercontent.com/u/6307904?v=4",
"profile": "https://github.com/charlesfinley",
"contributions": [
"code"
]
},
{
"login": "MananS77",
"name": "Manan",
"avatar_url": "https://avatars3.githubusercontent.com/u/21033516?v=4",
"profile": "https://github.com/MananS77",
"contributions": [
"review"
]
} }
], ],
"contributorsPerLine": 4, "contributorsPerLine": 4,

139
README.md
View File

@ -9,7 +9,7 @@
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns) [![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-116-orange.svg?style=flat-square)](#contributors-) [![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
# Introduction # Introduction
@ -114,133 +114,36 @@ This project is licensed under the terms of the MIT license.
<td align="center"><a href="https://github.com/gvsharma"><img src="https://avatars1.githubusercontent.com/u/6648152?v=4" width="100px;" alt=""/><br /><sub><b>GVSharma</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gvsharma" title="Code">💻</a></td> <td align="center"><a href="https://github.com/gvsharma"><img src="https://avatars1.githubusercontent.com/u/6648152?v=4" width="100px;" alt=""/><br /><sub><b>GVSharma</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gvsharma" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/SrdjanPaunovic"><img src="https://avatars1.githubusercontent.com/u/22815104?v=4" width="100px;" alt=""/><br /><sub><b>Srđan Paunović</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=SrdjanPaunovic" title="Code">💻</a></td> <td align="center"><a href="https://github.com/SrdjanPaunovic"><img src="https://avatars1.githubusercontent.com/u/22815104?v=4" width="100px;" alt=""/><br /><sub><b>Srđan Paunović</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=SrdjanPaunovic" title="Code">💻</a></td>
<td align="center"><a href="https://sideris.xyz/"><img src="https://avatars3.githubusercontent.com/u/5484694?v=4" width="100px;" alt=""/><br /><sub><b>Petros G. Sideris</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=sideris" title="Code">💻</a></td> <td align="center"><a href="https://sideris.xyz/"><img src="https://avatars3.githubusercontent.com/u/5484694?v=4" width="100px;" alt=""/><br /><sub><b>Petros G. Sideris</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=sideris" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/pramodgupta3/"><img src="https://avatars1.githubusercontent.com/u/2184241?v=4" width="100px;" alt=""/><br /><sub><b>Pramod Gupta</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3AIAmPramod" title="Reviewed Pull Requests">👀</a></td>
</tr>
<tr>
<td align="center"><a href="https://amarnath510.github.io/portfolio"><img src="https://avatars0.githubusercontent.com/u/4599623?v=4" width="100px;" alt=""/><br /><sub><b>Amarnath Chandana</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Amarnath510" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Anurag870"><img src="https://avatars1.githubusercontent.com/u/6295975?v=4" width="100px;" alt=""/><br /><sub><b>Anurag870</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Anurag870" title="Code">💻</a></td>
<td align="center"><a href="http://theerroris.me"><img src="https://avatars0.githubusercontent.com/u/1685953?v=4" width="100px;" alt=""/><br /><sub><b>Wes Gilleland</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Deathnerd" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Harshrajsinh"><img src="https://avatars2.githubusercontent.com/u/22811531?v=4" width="100px;" alt=""/><br /><sub><b>Harshraj Thakor</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Harshrajsinh" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/MaVdbussche"><img src="https://avatars1.githubusercontent.com/u/26136934?v=4" width="100px;" alt=""/><br /><sub><b>Martin Vandenbussche</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=MaVdbussche" title="Code">💻</a></td>
<td align="center"><a href="https://alexsomai.com"><img src="https://avatars1.githubusercontent.com/u/5720977?v=4" width="100px;" alt=""/><br /><sub><b>Alexandru Somai</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=alexsomai" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/amogozov"><img src="https://avatars3.githubusercontent.com/u/7372215?v=4" width="100px;" alt=""/><br /><sub><b>Artur Mogozov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amogozov" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/anthonycampbell"><img src="https://avatars3.githubusercontent.com/u/10249255?v=4" width="100px;" alt=""/><br /><sub><b>anthony</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=anthonycampbell" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://ccygnus.com/"><img src="https://avatars1.githubusercontent.com/u/9342724?v=4" width="100px;" alt=""/><br /><sub><b>Christian Cygnus</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=christophercolumbusdog" title="Code">💻</a></td>
<td align="center"><a href="https://about.me/dzmitryh"><img src="https://avatars2.githubusercontent.com/u/5390492?v=4" width="100px;" alt=""/><br /><sub><b>Dima Gubin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dzmitryh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/jjjimenez100"><img src="https://avatars3.githubusercontent.com/u/22243493?v=4" width="100px;" alt=""/><br /><sub><b>Joshua Jimenez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=jjjimenez100" title="Code">💻</a></td>
<td align="center"><a href="http://about.me/kaiwinter"><img src="https://avatars0.githubusercontent.com/u/110982?v=4" width="100px;" alt=""/><br /><sub><b>Kai Winter</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kaiwinter" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/lbroman"><img src="https://avatars1.githubusercontent.com/u/86007?v=4" width="100px;" alt=""/><br /><sub><b>lbroman</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=lbroman" title="Code">💻</a></td>
<td align="center"><a href="https://przemeknowak.com"><img src="https://avatars1.githubusercontent.com/u/3254609?v=4" width="100px;" alt=""/><br /><sub><b>Przemek</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=pnowy" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/prafful1"><img src="https://avatars0.githubusercontent.com/u/14350274?v=4" width="100px;" alt=""/><br /><sub><b>Prafful Agarwal</b></sub></a><br /><a href="#content-prafful1" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/sankypanhale"><img src="https://avatars1.githubusercontent.com/u/6478783?v=4" width="100px;" alt=""/><br /><sub><b>Sanket Panhale</b></sub></a><br /><a href="#content-sankypanhale" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/staillebois"><img src="https://avatars0.githubusercontent.com/u/23701200?v=4" width="100px;" alt=""/><br /><sub><b>staillebois</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=staillebois" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/valdar-hu"><img src="https://avatars3.githubusercontent.com/u/17962817?v=4" width="100px;" alt=""/><br /><sub><b>Krisztián Nagy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=valdar-hu" title="Code">💻</a></td>
<td align="center"><a href="https://www.vanogrid.com"><img src="https://avatars0.githubusercontent.com/u/4307918?v=4" width="100px;" alt=""/><br /><sub><b>Alexander Ivanov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vanogrid" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/yosfik"><img src="https://avatars3.githubusercontent.com/u/4850270?v=4" width="100px;" alt=""/><br /><sub><b>Yosfik Alqadri</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=yosfik" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/7agustibm"><img src="https://avatars0.githubusercontent.com/u/8149332?v=4" width="100px;" alt=""/><br /><sub><b>Agustí Becerra Milà</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=7agustibm" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Juaanma"><img src="https://avatars3.githubusercontent.com/u/7390500?v=4" width="100px;" alt=""/><br /><sub><b>Juan Manuel Suárez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Juaanma" title="Code">💻</a></td>
<td align="center"><a href="http://www.devsedge.net/"><img src="https://avatars0.githubusercontent.com/u/9956006?v=4" width="100px;" alt=""/><br /><sub><b>Luigi Cortese</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=LuigiCortese" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Rzeposlaw"><img src="https://avatars2.githubusercontent.com/u/18425745?v=4" width="100px;" alt=""/><br /><sub><b>Katarzyna Rzepecka</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Rzeposlaw" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://adamski.pro"><img src="https://avatars1.githubusercontent.com/u/6537430?v=4" width="100px;" alt=""/><br /><sub><b>adamski.pro</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=akrystian" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/baislsl"><img src="https://avatars0.githubusercontent.com/u/17060584?v=4" width="100px;" alt=""/><br /><sub><b>Shengli Bai</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=baislsl" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/besok"><img src="https://avatars2.githubusercontent.com/u/29834592?v=4" width="100px;" alt=""/><br /><sub><b>Boris</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=besok" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dmitraver"><img src="https://avatars3.githubusercontent.com/u/1798156?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Avershin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dmitraver" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/fanofxiaofeng"><img src="https://avatars0.githubusercontent.com/u/3983683?v=4" width="100px;" alt=""/><br /><sub><b>靳阳</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=fanofxiaofeng" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hoangnam2261"><img src="https://avatars2.githubusercontent.com/u/31692990?v=4" width="100px;" alt=""/><br /><sub><b>hoangnam2261</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hoangnam2261" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/jarpit96"><img src="https://avatars2.githubusercontent.com/u/10098713?v=4" width="100px;" alt=""/><br /><sub><b>Arpit Jain</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=jarpit96" title="Code">💻</a></td>
<td align="center"><a href="http://joningi.net"><img src="https://avatars2.githubusercontent.com/u/6115148?v=4" width="100px;" alt=""/><br /><sub><b>Jón Ingi Sveinbjörnsson</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=joningiwork" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/kirill-vlasov"><img src="https://avatars3.githubusercontent.com/u/16112495?v=4" width="100px;" alt=""/><br /><sub><b>Kirill Vlasov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kirill-vlasov" title="Code">💻</a></td>
<td align="center"><a href="http://mitchell-irvin.com"><img src="https://avatars0.githubusercontent.com/u/16233245?v=4" width="100px;" alt=""/><br /><sub><b>Mitchell Irvin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mitchellirvin" title="Code">💻</a></td>
<td align="center"><a href="https://ranjeet-floyd.github.io"><img src="https://avatars0.githubusercontent.com/u/1992972?v=4" width="100px;" alt=""/><br /><sub><b>Ranjeet</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ranjeet-floyd" title="Code">💻</a></td>
<td align="center"><a href="https://alwayswithme.github.io"><img src="https://avatars3.githubusercontent.com/u/3234786?v=4" width="100px;" alt=""/><br /><sub><b>PhoenixYip</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Alwayswithme" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/MSaifAsif"><img src="https://avatars1.githubusercontent.com/u/6280554?v=4" width="100px;" alt=""/><br /><sub><b>M Saif Asif</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=MSaifAsif" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/kanwarpreet25"><img src="https://avatars0.githubusercontent.com/u/39183641?v=4" width="100px;" alt=""/><br /><sub><b>kanwarpreet25</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kanwarpreet25" title="Code">💻</a></td>
<td align="center"><a href="http://leonmak.me"><img src="https://avatars3.githubusercontent.com/u/13071508?v=4" width="100px;" alt=""/><br /><sub><b>Leon Mak</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=leonmak" title="Code">💻</a></td>
<td align="center"><a href="http://www.wramdemark.se"><img src="https://avatars2.githubusercontent.com/u/7052193?v=4" width="100px;" alt=""/><br /><sub><b>Per Wramdemark</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=perwramdemark" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/waisuan"><img src="https://avatars2.githubusercontent.com/u/10975700?v=4" width="100px;" alt=""/><br /><sub><b>Evan Sia Wai Suan</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=waisuan" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/AnaghaSasikumar"><img src="https://avatars2.githubusercontent.com/u/42939261?v=4" width="100px;" alt=""/><br /><sub><b>AnaghaSasikumar</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=AnaghaSasikumar" title="Code">💻</a></td>
<td align="center"><a href="https://christofferh.com"><img src="https://avatars1.githubusercontent.com/u/767643?v=4" width="100px;" alt=""/><br /><sub><b>Christoffer Hamberg</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=christofferh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dgruntz"><img src="https://avatars0.githubusercontent.com/u/1516800?v=4" width="100px;" alt=""/><br /><sub><b>Dominik Gruntz</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dgruntz" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://bitbucket.org/hannespernpeintner/"><img src="https://avatars3.githubusercontent.com/u/1679437?v=4" width="100px;" alt=""/><br /><sub><b>Hannes</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hannespernpeintner" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/leogtzr"><img src="https://avatars0.githubusercontent.com/u/1211969?v=4" width="100px;" alt=""/><br /><sub><b>Leo Gutiérrez Ramírez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=leogtzr" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/npczwh"><img src="https://avatars0.githubusercontent.com/u/14066422?v=4" width="100px;" alt=""/><br /><sub><b>Zhang WH</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=npczwh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/oconnelc"><img src="https://avatars0.githubusercontent.com/u/1112973?v=4" width="100px;" alt=""/><br /><sub><b>Christopher O'Connell</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=oconnelc" title="Code">💻</a></td> <td align="center"><a href="https://github.com/oconnelc"><img src="https://avatars0.githubusercontent.com/u/1112973?v=4" width="100px;" alt=""/><br /><sub><b>Christopher O'Connell</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=oconnelc" title="Code">💻</a></td>
</tr> </tr>
<tr> <tr>
<td align="center"><a href="https://github.com/giorgosmav21"><img src="https://avatars2.githubusercontent.com/u/22855493?v=4" width="100px;" alt=""/><br /><sub><b>George Mavroeidis</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=giorgosmav21" title="Code">💻</a></td> <td align="center"><a href="https://github.com/qza"><img src="https://avatars3.githubusercontent.com/u/233149?v=4" width="100px;" alt=""/><br /><sub><b>qza</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=qza" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hbothra15"><img src="https://avatars1.githubusercontent.com/u/7418012?v=4" width="100px;" alt=""/><br /><sub><b>Hemant Bothra</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hbothra15" title="Code">💻</a> <a href="#design-hbothra15" title="Design">🎨</a></td> <td align="center"><a href="http://tschis.github.io"><img src="https://avatars1.githubusercontent.com/u/20662669?v=4" width="100px;" alt=""/><br /><sub><b>Rodolfo Forte</b></sub></a><br /><a href="#content-Tschis" title="Content">🖋</a></td>
<td align="center"><a href="https://www.kevinpeters.net/about/"><img src="https://avatars1.githubusercontent.com/u/12736734?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Peters</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=igeligel" title="Code">💻</a></td> <td align="center"><a href="https://github.com/ankurkaushal"><img src="https://avatars2.githubusercontent.com/u/2236616?v=4" width="100px;" alt=""/><br /><sub><b>Ankur Kaushal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ankurkaushal" title="Code">💻</a></td>
<td align="center"><a href="https://llorllale.github.io/"><img src="https://avatars1.githubusercontent.com/u/2019896?v=4" width="100px;" alt=""/><br /><sub><b>George Aristy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=llorllale" title="Code">💻</a></td> <td align="center"><a href="https://www.linkedin.com/in/ovidijus-okinskas/"><img src="https://avatars0.githubusercontent.com/u/20372387?v=4" width="100px;" alt=""/><br /><sub><b>Ovidijus Okinskas</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=okinskas" title="Code">💻</a></td>
</tr> </tr>
<tr> <tr>
<td align="center"><a href="https://github.com/mookkiah"><img src="https://avatars1.githubusercontent.com/u/8975264?v=4" width="100px;" alt=""/><br /><sub><b>Mahendran Mookkiah</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mookkiah" title="Code">💻</a></td> <td align="center"><a href="https://twitter.com/StPitsios"><img src="https://avatars1.githubusercontent.com/u/6773603?v=4" width="100px;" alt=""/><br /><sub><b>Stamatis Pitsios</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=pitsios-s" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Azureyjt"><img src="https://avatars2.githubusercontent.com/u/18476317?v=4" width="100px;" alt=""/><br /><sub><b>Azureyjt</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Azureyjt" title="Code">💻</a></td> <td align="center"><a href="https://github.com/robertt240"><img src="https://avatars1.githubusercontent.com/u/9137432?v=4" width="100px;" alt=""/><br /><sub><b>Robert Kasperczyk</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=robertt240" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vehpsr"><img src="https://avatars2.githubusercontent.com/u/3133265?v=4" width="100px;" alt=""/><br /><sub><b>gans</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vehpsr" title="Code">💻</a></td> <td align="center"><a href="https://t.me/paul_docker"><img src="https://avatars1.githubusercontent.com/u/2404785?v=4" width="100px;" alt=""/><br /><sub><b>田浩</b></sub></a><br /><a href="#content-llitfkitfk" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/gwildor28"><img src="https://avatars0.githubusercontent.com/u/16000365?v=4" width="100px;" alt=""/><br /><sub><b>gwildor28</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gwildor28" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/amit2103"><img src="https://avatars3.githubusercontent.com/u/7566692?v=4" width="100px;" alt=""/><br /><sub><b>Amit Pandey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amit2103" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hoswey"><img src="https://avatars3.githubusercontent.com/u/3689445?v=4" width="100px;" alt=""/><br /><sub><b>Hoswey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hoswey" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/gopinathlangote/"><img src="https://avatars2.githubusercontent.com/u/10210778?v=4" width="100px;" alt=""/><br /><sub><b>Gopinath Langote</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gopinath-langote" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ThatGuyWithTheHat"><img src="https://avatars0.githubusercontent.com/u/24470582?v=4" width="100px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /><a href="#content-ThatGuyWithTheHat" title="Content">🖋</a></td> <td align="center"><a href="https://github.com/ThatGuyWithTheHat"><img src="https://avatars0.githubusercontent.com/u/24470582?v=4" width="100px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /><a href="#content-ThatGuyWithTheHat" title="Content">🖋</a></td>
</tr> </tr>
<tr> <tr>
<td align="center"><a href="https://www.linkedin.com/in/gopinathlangote/"><img src="https://avatars2.githubusercontent.com/u/10210778?v=4" width="100px;" alt=""/><br /><sub><b>Gopinath Langote</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gopinath-langote" title="Code">💻</a></td> <td align="center"><a href="https://github.com/vehpsr"><img src="https://avatars2.githubusercontent.com/u/3133265?v=4" width="100px;" alt=""/><br /><sub><b>gans</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vehpsr" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hoswey"><img src="https://avatars3.githubusercontent.com/u/3689445?v=4" width="100px;" alt=""/><br /><sub><b>Hoswey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hoswey" title="Code">💻</a></td> <td align="center"><a href="https://github.com/Azureyjt"><img src="https://avatars2.githubusercontent.com/u/18476317?v=4" width="100px;" alt=""/><br /><sub><b>Azureyjt</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Azureyjt" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/amit2103"><img src="https://avatars3.githubusercontent.com/u/7566692?v=4" width="100px;" alt=""/><br /><sub><b>Amit Pandey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amit2103" title="Code">💻</a></td> <td align="center"><a href="https://github.com/mookkiah"><img src="https://avatars1.githubusercontent.com/u/8975264?v=4" width="100px;" alt=""/><br /><sub><b>Mahendran Mookkiah</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mookkiah" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/gwildor28"><img src="https://avatars0.githubusercontent.com/u/16000365?v=4" width="100px;" alt=""/><br /><sub><b>gwildor28</b></sub></a><br /><a href="#content-gwildor28" title="Content">🖋</a></td> <td align="center"><a href="https://llorllale.github.io/"><img src="https://avatars1.githubusercontent.com/u/2019896?v=4" width="100px;" alt=""/><br /><sub><b>George Aristy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=llorllale" title="Code">💻</a></td>
</tr> </tr>
<tr> <tr>
<td align="center"><a href="https://t.me/paul_docker"><img src="https://avatars1.githubusercontent.com/u/2404785?v=4" width="100px;" alt=""/><br /><sub><b>田浩</b></sub></a><br /><a href="#content-llitfkitfk" title="Content">🖋</a></td> <td align="center"><a href="https://www.kevinpeters.net/about/"><img src="https://avatars1.githubusercontent.com/u/12736734?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Peters</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=igeligel" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/StPitsios"><img src="https://avatars1.githubusercontent.com/u/6773603?v=4" width="100px;" alt=""/><br /><sub><b>Stamatis Pitsios</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=pitsios-s" title="Code">💻</a></td> <td align="center"><a href="https://github.com/hbothra15"><img src="https://avatars1.githubusercontent.com/u/7418012?v=4" width="100px;" alt=""/><br /><sub><b>Hemant Bothra</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hbothra15" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/qza"><img src="https://avatars3.githubusercontent.com/u/233149?v=4" width="100px;" alt=""/><br /><sub><b>qza</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=qza" title="Code">💻</a></td> <td align="center"><a href="https://github.com/giorgosmav21"><img src="https://avatars2.githubusercontent.com/u/22855493?v=4" width="100px;" alt=""/><br /><sub><b>George Mavroeidis</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=giorgosmav21" title="Code">💻</a></td>
<td align="center"><a href="http://tschis.github.io"><img src="https://avatars1.githubusercontent.com/u/20662669?v=4" width="100px;" alt=""/><br /><sub><b>Rodolfo Forte</b></sub></a><br /><a href="#content-Tschis" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ankurkaushal"><img src="https://avatars2.githubusercontent.com/u/2236616?v=4" width="100px;" alt=""/><br /><sub><b>Ankur Kaushal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ankurkaushal" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/ovidijus-okinskas/"><img src="https://avatars0.githubusercontent.com/u/20372387?v=4" width="100px;" alt=""/><br /><sub><b>Ovidijus Okinskas</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=okinskas" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/robertt240"><img src="https://avatars1.githubusercontent.com/u/9137432?v=4" width="100px;" alt=""/><br /><sub><b>Robert Kasperczyk</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=robertt240" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/trautonen"><img src="https://avatars3.githubusercontent.com/u/1641063?v=4" width="100px;" alt=""/><br /><sub><b>Tapio Rautonen</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=trautonen" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://vk.com/yuri.orlov"><img src="https://avatars0.githubusercontent.com/u/1595733?v=4" width="100px;" alt=""/><br /><sub><b>Yuri Orlov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=yorlov" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/varunu28/"><img src="https://avatars0.githubusercontent.com/u/7676016?v=4" width="100px;" alt=""/><br /><sub><b>Varun Upadhyay</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=varunu28" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/PalAditya"><img src="https://avatars2.githubusercontent.com/u/25523604?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Pal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=PalAditya" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/grzesiekkedzior"><img src="https://avatars3.githubusercontent.com/u/23739158?v=4" width="100px;" alt=""/><br /><sub><b>grzesiekkedzior</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=grzesiekkedzior" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/sivasubramanim"><img src="https://avatars2.githubusercontent.com/u/51107434?v=4" width="100px;" alt=""/><br /><sub><b>Sivasubramani M</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=sivasubramanim" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/d4gg4d"><img src="https://avatars2.githubusercontent.com/u/99457?v=4" width="100px;" alt=""/><br /><sub><b>Sami Airaksinen</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=d4gg4d" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vertti"><img src="https://avatars0.githubusercontent.com/u/557751?v=4" width="100px;" alt=""/><br /><sub><b>Janne Sinivirta</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vertti" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Bobo1239"><img src="https://avatars1.githubusercontent.com/u/2302947?v=4" width="100px;" alt=""/><br /><sub><b>Boris-Chengbiao Zhou</b></sub></a><br /><a href="#content-Bobo1239" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://jahhein.github.io"><img src="https://avatars2.githubusercontent.com/u/10779515?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Hein</b></sub></a><br /><a href="#content-Jahhein" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/iamrichardjones"><img src="https://avatars3.githubusercontent.com/u/14842151?v=4" width="100px;" alt=""/><br /><sub><b>Richard Jones</b></sub></a><br /><a href="#content-iamrichardjones" title="Content">🖋</a></td>
<td align="center"><a href="https://rachelcarmena.github.io"><img src="https://avatars0.githubusercontent.com/u/22792183?v=4" width="100px;" alt=""/><br /><sub><b>Rachel M. Carmena</b></sub></a><br /><a href="#content-rachelcarmena" title="Content">🖋</a></td>
<td align="center"><a href="https://zd-zero.github.io"><img src="https://avatars0.githubusercontent.com/u/21978370?v=4" width="100px;" alt=""/><br /><sub><b>Zaerald Denze Lungos</b></sub></a><br /><a href="#content-zd-zero" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://webpro.nl"><img src="https://avatars1.githubusercontent.com/u/456426?v=4" width="100px;" alt=""/><br /><sub><b>Lars Kappert</b></sub></a><br /><a href="#content-webpro" title="Content">🖋</a></td>
<td align="center"><a href="https://xiaod.info"><img src="https://avatars2.githubusercontent.com/u/21277644?v=4" width="100px;" alt=""/><br /><sub><b>Mike Liu</b></sub></a><br /><a href="#translation-xiaod-dev" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/charlesfinley"><img src="https://avatars1.githubusercontent.com/u/6307904?v=4" width="100px;" alt=""/><br /><sub><b>Matt Dolan</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=charlesfinley" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/MananS77"><img src="https://avatars3.githubusercontent.com/u/21033516?v=4" width="100px;" alt=""/><br /><sub><b>Manan</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3AMananS77" title="Reviewed Pull Requests">👀</a></td>
</tr> </tr>
</table> </table>

View File

@ -9,182 +9,21 @@ tags:
--- ---
## Intent ## Intent
Achieve flexibility of untyped languages and keep the type-safety
Use dynamic properties and achieve flexibility of untyped languages while keeping type-safety.
## Explanation
The Abstract Document pattern enables handling additional, non-static properties. This pattern
uses concept of traits to enable type safety and separate properties of different classes into
set of interfaces.
Real world example
> Consider a car that consists of multiple parts. However we don't know if the specific car really has all the parts, or just some of them. Our cars are dynamic and extremely flexible.
In plain words
> Abstract Document pattern allows attaching properties to objects without them knowing about it.
Wikipedia says
> An object-oriented structural design pattern for organizing objects in loosely typed key-value stores and exposing
the data using typed views. The purpose of the pattern is to achieve a high degree of flexibility between components
in a strongly typed language where new properties can be added to the object-tree on the fly, without losing the
support of type-safety. The pattern makes use of traits to separate different properties of a class into different
interfaces.
**Programmatic Example**
Let's first define the base classes `Document` and `AbstractDocument`. They basically make the object hold a property
map and any amount of child objects.
```java
public interface Document {
Void put(String key, Object value);
Object get(String key);
<T> Stream<T> children(String key, Function<Map<String, Object>, T> constructor);
}
public abstract class AbstractDocument implements Document {
private final Map<String, Object> properties;
protected AbstractDocument(Map<String, Object> properties) {
Objects.requireNonNull(properties, "properties map is required");
this.properties = properties;
}
@Override
public Void put(String key, Object value) {
properties.put(key, value);
return null;
}
@Override
public Object get(String key) {
return properties.get(key);
}
@Override
public <T> Stream<T> children(String key, Function<Map<String, Object>, T> constructor) {
return Stream.ofNullable(get(key))
.filter(Objects::nonNull)
.map(el -> (List<Map<String, Object>>) el)
.findAny()
.stream()
.flatMap(Collection::stream)
.map(constructor);
}
...
}
```
Next we define an enum `Property` and a set of interfaces for type, price, model and parts. This allows us to create
static looking interface to our `Car` class.
```java
public enum Property {
PARTS, TYPE, PRICE, MODEL
}
public interface HasType extends Document {
default Optional<String> getType() {
return Optional.ofNullable((String) get(Property.TYPE.toString()));
}
}
public interface HasPrice extends Document {
default Optional<Number> getPrice() {
return Optional.ofNullable((Number) get(Property.PRICE.toString()));
}
}
public interface HasModel extends Document {
default Optional<String> getModel() {
return Optional.ofNullable((String) get(Property.MODEL.toString()));
}
}
public interface HasParts extends Document {
default Stream<Part> getParts() {
return children(Property.PARTS.toString(), Part::new);
}
}
```
Now we are ready to introduce the `Car`.
```java
public class Car extends AbstractDocument implements HasModel, HasPrice, HasParts {
public Car(Map<String, Object> properties) {
super(properties);
}
}
```
And finally here's how we construct and use the `Car` in a full example.
```java
LOGGER.info("Constructing parts and car");
var wheelProperties = Map.of(
Property.TYPE.toString(), "wheel",
Property.MODEL.toString(), "15C",
Property.PRICE.toString(), 100L);
var doorProperties = Map.of(
Property.TYPE.toString(), "door",
Property.MODEL.toString(), "Lambo",
Property.PRICE.toString(), 300L);
var carProperties = Map.of(
Property.MODEL.toString(), "300SL",
Property.PRICE.toString(), 10000L,
Property.PARTS.toString(), List.of(wheelProperties, doorProperties));
var car = new Car(carProperties);
LOGGER.info("Here is our car:");
LOGGER.info("-> model: {}", car.getModel().orElseThrow());
LOGGER.info("-> price: {}", car.getPrice().orElseThrow());
LOGGER.info("-> parts: ");
car.getParts().forEach(p -> LOGGER.info("\t{}/{}/{}",
p.getType().orElse(null),
p.getModel().orElse(null),
p.getPrice().orElse(null))
);
// Constructing parts and car
// Here is our car:
// model: 300SL
// price: 10000
// parts:
// wheel/15C/100
// door/Lambo/300
```
## Class diagram ## Class diagram
![alt text](./etc/abstract-document.png "Abstract Document Traits and Domain") ![alt text](./etc/abstract-document.png "Abstract Document Traits and Domain")
## Applicability
## Applicability
Use the Abstract Document Pattern when Use the Abstract Document Pattern when
* There is a need to add new properties on the fly * there is a need to add new properties on the fly
* You want a flexible way to organize domain in tree like structure * you want a flexible way to organize domain in tree like structure
* You want more loosely coupled system * you want more loosely coupled system
## Credits ## Credits
* [Wikipedia: Abstract Document Pattern](https://en.wikipedia.org/wiki/Abstract_Document_Pattern) * [Wikipedia: Abstract Document Pattern](https://en.wikipedia.org/wiki/Abstract_Document_Pattern)
* [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf) * [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf)
* [Pattern-Oriented Software Architecture Volume 4: A Pattern Language for Distributed Computing (v. 4)](https://www.amazon.com/gp/product/0470059028/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=javadesignpat-20&creative=9325&linkCode=as2&creativeASIN=0470059028&linkId=e3aacaea7017258acf184f9f3283b492)

View File

@ -32,6 +32,7 @@ import java.util.stream.Stream;
*/ */
public interface HasParts extends Document { public interface HasParts extends Document {
default Stream<Part> getParts() { default Stream<Part> getParts() {
return children(Property.PARTS.toString(), Part::new); return children(Property.PARTS.toString(), Part::new);
} }

View File

@ -32,6 +32,7 @@ import java.util.Optional;
*/ */
public interface HasPrice extends Document { public interface HasPrice extends Document {
default Optional<Number> getPrice() { default Optional<Number> getPrice() {
return Optional.ofNullable((Number) get(Property.PRICE.toString())); return Optional.ofNullable((Number) get(Property.PRICE.toString()));
} }

View File

@ -32,6 +32,7 @@ import java.util.Optional;
*/ */
public interface HasType extends Document { public interface HasType extends Document {
default Optional<String> getType() { default Optional<String> getType() {
return Optional.ofNullable((String) get(Property.TYPE.toString())); return Optional.ofNullable((String) get(Property.TYPE.toString()));
} }

View File

@ -47,7 +47,7 @@ public class AbstractDocumentTest {
} }
} }
private final DocumentImplementation document = new DocumentImplementation(new HashMap<>()); private DocumentImplementation document = new DocumentImplementation(new HashMap<>());
@Test @Test
public void shouldPutAndGetValue() { public void shouldPutAndGetValue() {

View File

@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class AbstractFactoryTest { public class AbstractFactoryTest {
private final App app = new App(); private App app = new App();
private KingdomFactory elfFactory; private KingdomFactory elfFactory;
private KingdomFactory orcFactory; private KingdomFactory orcFactory;

View File

@ -37,7 +37,7 @@ import uk.org.lidalia.slf4jtest.TestLoggerFactory;
*/ */
public class ConfigureForDosVisitorTest { public class ConfigureForDosVisitorTest {
private final TestLogger logger = TestLoggerFactory.getTestLogger(ConfigureForDosVisitor.class); private TestLogger logger = TestLoggerFactory.getTestLogger(ConfigureForDosVisitor.class);
@Test @Test
public void testVisitForZoom() { public void testVisitForZoom() {

View File

@ -56,7 +56,7 @@ And captain expects an implementation of `RowingBoat` interface to be able to mo
```java ```java
public class Captain { public class Captain {
private final RowingBoat rowingBoat; private RowingBoat rowingBoat;
// default constructor and setter for rowingBoat // default constructor and setter for rowingBoat
public Captain(RowingBoat rowingBoat) { public Captain(RowingBoat rowingBoat) {
this.rowingBoat = rowingBoat; this.rowingBoat = rowingBoat;
@ -75,7 +75,7 @@ public class FishingBoatAdapter implements RowingBoat {
private static final Logger LOGGER = LoggerFactory.getLogger(FishingBoatAdapter.class); private static final Logger LOGGER = LoggerFactory.getLogger(FishingBoatAdapter.class);
private final FishingBoat boat; private FishingBoat boat;
public FishingBoatAdapter() { public FishingBoatAdapter() {
boat = new FishingBoat(); boat = new FishingBoat();

View File

@ -29,7 +29,7 @@ package com.iluwatar.adapter;
*/ */
public class FishingBoatAdapter implements RowingBoat { public class FishingBoatAdapter implements RowingBoat {
private final FishingBoat boat; private FishingBoat boat;
public FishingBoatAdapter() { public FishingBoatAdapter() {
boat = new FishingBoat(); boat = new FishingBoat();

View File

@ -48,7 +48,7 @@ class RemoteServiceTest {
} }
private static class StaticRandomProvider implements RandomProvider { private static class StaticRandomProvider implements RandomProvider {
private final double value; private double value;
StaticRandomProvider(double value) { StaticRandomProvider(double value) {
this.value = value; this.value = value;

View File

@ -60,7 +60,7 @@ public class CashAAATest {
//Act //Act
cash.plus(4); cash.plus(4);
//Assert //Assert
assertEquals(7, cash.count()); assertEquals(cash.count(), 7);
} }
@Test @Test
@ -71,7 +71,7 @@ public class CashAAATest {
var result = cash.minus(5); var result = cash.minus(5);
//Assert //Assert
assertTrue(result); assertTrue(result);
assertEquals(3, cash.count()); assertEquals(cash.count(), 3);
} }
@Test @Test
@ -82,7 +82,7 @@ public class CashAAATest {
var result = cash.minus(6); var result = cash.minus(6);
//Assert //Assert
assertFalse(result); assertFalse(result);
assertEquals(1, cash.count()); assertEquals(cash.count(), 1);
} }
@Test @Test
@ -94,6 +94,6 @@ public class CashAAATest {
var result = cash.minus(3); var result = cash.minus(3);
//Assert //Assert
assertTrue(result); assertTrue(result);
assertEquals(8, cash.count()); assertEquals(cash.count(), 8);
} }
} }

View File

@ -44,16 +44,16 @@ public class CashAntiAAATest {
var cash = new Cash(3); var cash = new Cash(3);
//test plus //test plus
cash.plus(4); cash.plus(4);
assertEquals(7, cash.count()); assertEquals(cash.count(), 7);
//test minus //test minus
cash = new Cash(8); cash = new Cash(8);
assertTrue(cash.minus(5)); assertTrue(cash.minus(5));
assertEquals(3, cash.count()); assertEquals(cash.count(), 3);
assertFalse(cash.minus(6)); assertFalse(cash.minus(6));
assertEquals(3, cash.count()); assertEquals(cash.count(), 3);
//test update //test update
cash.plus(5); cash.plus(5);
assertTrue(cash.minus(5)); assertTrue(cash.minus(5));
assertEquals(3, cash.count()); assertEquals(cash.count(), 3);
} }
} }

View File

@ -100,7 +100,7 @@ public class ThreadAsyncExecutor implements AsyncExecutor {
void setValue(T value) { void setValue(T value) {
this.value = value; this.value = value;
this.state = COMPLETED; this.state = COMPLETED;
this.callback.ifPresent(ac -> ac.onComplete(value, Optional.empty())); this.callback.ifPresent(ac -> ac.onComplete(value, Optional.<Exception>empty()));
synchronized (lock) { synchronized (lock) {
lock.notifyAll(); lock.notifyAll();
} }

View File

@ -28,7 +28,7 @@ package com.iluwatar.business.delegate;
*/ */
public class Client { public class Client {
private final BusinessDelegate businessDelegate; private BusinessDelegate businessDelegate;
public Client(BusinessDelegate businessDelegate) { public Client(BusinessDelegate businessDelegate) {
this.businessDelegate = businessDelegate; this.businessDelegate = businessDelegate;

View File

@ -28,5 +28,5 @@ package com.iluwatar.business.delegate;
*/ */
public enum ServiceType { public enum ServiceType {
EJB, JMS EJB, JMS;
} }

View File

@ -30,9 +30,9 @@ import java.util.Stack;
*/ */
public class VirtualMachine { public class VirtualMachine {
private final Stack<Integer> stack = new Stack<>(); private Stack<Integer> stack = new Stack<>();
private final Wizard[] wizards = new Wizard[2]; private Wizard[] wizards = new Wizard[2];
/** /**
* Constructor. * Constructor.

View File

@ -104,7 +104,7 @@ public class VirtualMachineTest {
bytecode[2] = LITERAL.getIntValue(); bytecode[2] = LITERAL.getIntValue();
bytecode[3] = 50; // health amount bytecode[3] = 50; // health amount
bytecode[4] = SET_HEALTH.getIntValue(); bytecode[4] = SET_HEALTH.getIntValue();
bytecode[5] = LITERAL.getIntValue(); bytecode[5] = LITERAL.getIntValue();;
bytecode[6] = wizardNumber; bytecode[6] = wizardNumber;
bytecode[7] = GET_HEALTH.getIntValue(); bytecode[7] = GET_HEALTH.getIntValue();

View File

@ -29,7 +29,7 @@ package com.iluwatar.caching;
public enum CachingPolicy { public enum CachingPolicy {
THROUGH("through"), AROUND("around"), BEHIND("behind"), ASIDE("aside"); THROUGH("through"), AROUND("around"), BEHIND("behind"), ASIDE("aside");
private final String policy; private String policy;
CachingPolicy(String policy) { CachingPolicy(String policy) {
this.policy = policy; this.policy = policy;

View File

@ -65,7 +65,7 @@ Then the request handler hierarchy
```java ```java
public abstract class RequestHandler { public abstract class RequestHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class); private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class);
private final RequestHandler next; private RequestHandler next;
public RequestHandler(RequestHandler next) { public RequestHandler(RequestHandler next) {
this.next = next; this.next = next;

View File

@ -33,7 +33,7 @@ public abstract class RequestHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class); private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class);
private final RequestHandler next; private RequestHandler next;
public RequestHandler(RequestHandler next) { public RequestHandler(RequestHandler next) {
this.next = next; this.next = next;

View File

@ -87,7 +87,10 @@ public class Car {
} else if (!model.equals(other.model)) { } else if (!model.equals(other.model)) {
return false; return false;
} }
return year == other.year; if (year != other.year) {
return false;
}
return true;
} }
public String getMake() { public String getMake() {

View File

@ -29,7 +29,7 @@ import java.util.List;
* A Person class that has the list of cars that the person owns and use. * A Person class that has the list of cars that the person owns and use.
*/ */
public class Person { public class Person {
private final List<Car> cars; private List<Car> cars;
/** /**
* Constructor to create an instance of person. * Constructor to create an instance of person.

View File

@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public class AppTest { public class AppTest {
private static final Logger LOGGER = LoggerFactory.getLogger(AppTest.class); private static final Logger LOGGER = LoggerFactory.getLogger(AppTest.class);
private final List<Car> cars = CarFactory.createCars(); private List<Car> cars = CarFactory.createCars();
@Test @Test
public void testGetModelsAfter2000UsingFor() { public void testGetModelsAfter2000UsingFor() {

View File

@ -36,8 +36,8 @@ public class Wizard {
private static final Logger LOGGER = LoggerFactory.getLogger(Wizard.class); private static final Logger LOGGER = LoggerFactory.getLogger(Wizard.class);
private final Deque<Command> undoStack = new LinkedList<>(); private Deque<Command> undoStack = new LinkedList<>();
private final Deque<Command> redoStack = new LinkedList<>(); private Deque<Command> redoStack = new LinkedList<>();
public Wizard() {} public Wizard() {}

View File

@ -1,43 +1,43 @@
/* /*
* The MIT License * The MIT License
* Copyright © 2014-2019 Ilkka Seppälä * Copyright © 2014-2019 Ilkka Seppälä
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package com.iluwatar.command; package com.iluwatar.command;
/** /**
* Enumeration for target size. * Enumeration for target size.
*/ */
public enum Size { public enum Size {
SMALL("small"), NORMAL("normal"); SMALL("small"), NORMAL("normal");
private final String title; private String title;
Size(String title) { Size(String title) {
this.title = title; this.title = title;
} }
@Override @Override
public String toString() { public String toString() {
return title; return title;
} }
} }

View File

@ -1,43 +1,43 @@
/* /*
* The MIT License * The MIT License
* Copyright © 2014-2019 Ilkka Seppälä * Copyright © 2014-2019 Ilkka Seppälä
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package com.iluwatar.command; package com.iluwatar.command;
/** /**
* Enumeration for target visibility. * Enumeration for target visibility.
*/ */
public enum Visibility { public enum Visibility {
VISIBLE("visible"), INVISIBLE("invisible"); VISIBLE("visible"), INVISIBLE("invisible");
private final String title; private String title;
Visibility(String title) { Visibility(String title) {
this.title = title; this.title = title;
} }
@Override @Override
public String toString() { public String toString() {
return title; return title;
} }
} }

View File

@ -35,8 +35,8 @@ public class Wizard {
private static final Logger LOGGER = LoggerFactory.getLogger(Wizard.class); private static final Logger LOGGER = LoggerFactory.getLogger(Wizard.class);
private final Deque<Command> undoStack = new LinkedList<>(); private Deque<Command> undoStack = new LinkedList<>();
private final Deque<Command> redoStack = new LinkedList<>(); private Deque<Command> redoStack = new LinkedList<>();
public Wizard() { public Wizard() {
// comment to ignore sonar issue: LEVEL critical // comment to ignore sonar issue: LEVEL critical

View File

@ -33,7 +33,7 @@ import java.util.Hashtable;
*/ */
public class EmployeeDatabase extends Database<Order> { public class EmployeeDatabase extends Database<Order> {
private final Hashtable<String, Order> data; private Hashtable<String, Order> data;
public EmployeeDatabase() { public EmployeeDatabase() {
this.data = new Hashtable<>(); this.data = new Hashtable<>();

View File

@ -33,7 +33,7 @@ import java.util.Hashtable;
*/ */
public class MessagingDatabase extends Database<MessageRequest> { public class MessagingDatabase extends Database<MessageRequest> {
private final Hashtable<String, MessageRequest> data; private Hashtable<String, MessageRequest> data;
public MessagingDatabase() { public MessagingDatabase() {
this.data = new Hashtable<>(); this.data = new Hashtable<>();

View File

@ -34,7 +34,7 @@ import java.util.Hashtable;
public class PaymentDatabase extends Database<PaymentRequest> { public class PaymentDatabase extends Database<PaymentRequest> {
private final Hashtable<String, PaymentRequest> data; private Hashtable<String, PaymentRequest> data;
public PaymentDatabase() { public PaymentDatabase() {
this.data = new Hashtable<>(); this.data = new Hashtable<>();

View File

@ -35,7 +35,7 @@ import java.util.List;
public class QueueDatabase extends Database<QueueTask> { public class QueueDatabase extends Database<QueueTask> {
private final Queue<QueueTask> data; private Queue<QueueTask> data;
public List<Exception> exceptionsList; public List<Exception> exceptionsList;
public QueueDatabase(Exception... exc) { public QueueDatabase(Exception... exc) {

View File

@ -34,7 +34,7 @@ import java.util.Hashtable;
public class ShippingDatabase extends Database<ShippingRequest> { public class ShippingDatabase extends Database<ShippingRequest> {
private final Hashtable<String, ShippingRequest> data; private Hashtable<String, ShippingRequest> data;
public ShippingDatabase() { public ShippingDatabase() {
this.data = new Hashtable<>(); this.data = new Hashtable<>();

View File

@ -34,7 +34,7 @@ Taking our sentence example from above. Here we have the base class and differen
```java ```java
public abstract class LetterComposite { public abstract class LetterComposite {
private final List<LetterComposite> children = new ArrayList<>(); private List<LetterComposite> children = new ArrayList<>();
public void add(LetterComposite letter) { public void add(LetterComposite letter) {
children.add(letter); children.add(letter);
@ -59,7 +59,7 @@ public abstract class LetterComposite {
public class Letter extends LetterComposite { public class Letter extends LetterComposite {
private final char character; private char character;
public Letter(char c) { public Letter(char c) {
this.character = c; this.character = c;

View File

@ -28,7 +28,7 @@ package com.iluwatar.composite;
*/ */
public class Letter extends LetterComposite { public class Letter extends LetterComposite {
private final char character; private char character;
public Letter(char c) { public Letter(char c) {
this.character = c; this.character = c;

View File

@ -1,58 +1,58 @@
/* /*
* The MIT License * The MIT License
* Copyright © 2014-2019 Ilkka Seppälä * Copyright © 2014-2019 Ilkka Seppälä
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package com.iluwatar.composite; package com.iluwatar.composite;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Composite interface. * Composite interface.
*/ */
public abstract class LetterComposite { public abstract class LetterComposite {
private final List<LetterComposite> children = new ArrayList<>(); private List<LetterComposite> children = new ArrayList<>();
public void add(LetterComposite letter) { public void add(LetterComposite letter) {
children.add(letter); children.add(letter);
} }
public int count() { public int count() {
return children.size(); return children.size();
} }
protected void printThisBefore() { protected void printThisBefore() {
} }
protected void printThisAfter() { protected void printThisAfter() {
} }
/** /**
* Print. * Print.
*/ */
public void print() { public void print() {
printThisBefore(); printThisBefore();
children.forEach(LetterComposite::print); children.forEach(LetterComposite::print);
printThisAfter(); printThisAfter();
} }
} }

View File

@ -29,10 +29,10 @@ import java.util.Objects;
* User class. * User class.
*/ */
public class User { public class User {
private final String firstName; private String firstName;
private final String lastName; private String lastName;
private final boolean isActive; private boolean isActive;
private final String userId; private String userId;
/** /**
* Constructor. * Constructor.

View File

@ -30,10 +30,10 @@ import java.util.Objects;
*/ */
public class UserDto { public class UserDto {
private final String firstName; private String firstName;
private final String lastName; private String lastName;
private final boolean isActive; private boolean isActive;
private final String email; private String email;
/** /**
* Constructor. * Constructor.

View File

@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class ConverterTest { public class ConverterTest {
private final UserConverter userConverter = new UserConverter(); private UserConverter userConverter = new UserConverter();
/** /**
* Tests whether a converter created of opposite functions holds equality as a bijection. * Tests whether a converter created of opposite functions holds equality as a bijection.

View File

@ -34,7 +34,7 @@ import org.hibernate.SessionFactory;
*/ */
public class CommandServiceImpl implements ICommandService { public class CommandServiceImpl implements ICommandService {
private final SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); private SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
private Author getAuthorByUsername(String username) { private Author getAuthorByUsername(String username) {
Author author; Author author;

View File

@ -38,7 +38,7 @@ import org.hibernate.transform.Transformers;
*/ */
public class QueryServiceImpl implements IQueryService { public class QueryServiceImpl implements IQueryService {
private final SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); private SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
@Override @Override
public Author getAuthorByUsername(String username) { public Author getAuthorByUsername(String username) {

View File

@ -112,7 +112,7 @@ public interface CustomerDao {
public class InMemoryCustomerDao implements CustomerDao { public class InMemoryCustomerDao implements CustomerDao {
private final Map<Integer, Customer> idToCustomer = new HashMap<>(); private Map<Integer, Customer> idToCustomer = new HashMap<>();
@Override @Override
public Stream<Customer> getAll() { public Stream<Customer> getAll() {

View File

@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
*/ */
public class App { public class App {
private static final String DB_URL = "jdbc:h2:~/dao"; private static final String DB_URL = "jdbc:h2:~/dao";
private static final Logger log = LoggerFactory.getLogger(App.class); private static Logger log = LoggerFactory.getLogger(App.class);
private static final String ALL_CUSTOMERS = "customerDao.getAllCustomers(): "; private static final String ALL_CUSTOMERS = "customerDao.getAllCustomers(): ";
/** /**

View File

@ -36,7 +36,7 @@ import java.util.stream.Stream;
*/ */
public class InMemoryCustomerDao implements CustomerDao { public class InMemoryCustomerDao implements CustomerDao {
private final Map<Integer, Customer> idToCustomer = new HashMap<>(); private Map<Integer, Customer> idToCustomer = new HashMap<>();
/** /**
* An eagerly evaluated stream of customers stored in memory. * An eagerly evaluated stream of customers stored in memory.

View File

@ -50,7 +50,7 @@ public class DbCustomerDaoTest {
private static final String DB_URL = "jdbc:h2:~/dao"; private static final String DB_URL = "jdbc:h2:~/dao";
private DbCustomerDao dao; private DbCustomerDao dao;
private final Customer existingCustomer = new Customer(1, "Freddy", "Krueger"); private Customer existingCustomer = new Customer(1, "Freddy", "Krueger");
/** /**
* Creates customers schema. * Creates customers schema.

View File

@ -41,7 +41,7 @@ public class MessageCollectorMember implements Member {
private final String name; private final String name;
private final List<String> messages = new ArrayList<>(); private List<String> messages = new ArrayList<>();
public MessageCollectorMember(String name) { public MessageCollectorMember(String name) {
this.name = name; this.name = name;

View File

@ -1,83 +1,83 @@
/* /*
* The MIT License * The MIT License
* Copyright © 2014-2019 Ilkka Seppälä * Copyright © 2014-2019 Ilkka Seppälä
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software. * all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package com.iluwatar.datamapper; package com.iluwatar.datamapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* The Data Mapper (DM) is a layer of software that separates the in-memory objects from the * The Data Mapper (DM) is a layer of software that separates the in-memory objects from the
* database. Its responsibility is to transfer data between the two and also to isolate them from * database. Its responsibility is to transfer data between the two and also to isolate them from
* each other. With Data Mapper the in-memory objects needn't know even that there's a database * each other. With Data Mapper the in-memory objects needn't know even that there's a database
* present; they need no SQL interface code, and certainly no knowledge of the database schema. (The * present; they need no SQL interface code, and certainly no knowledge of the database schema. (The
* database schema is always ignorant of the objects that use it.) Since it's a form of Mapper , * database schema is always ignorant of the objects that use it.) Since it's a form of Mapper ,
* Data Mapper itself is even unknown to the domain layer. * Data Mapper itself is even unknown to the domain layer.
* *
* <p>The below example demonstrates basic CRUD operations: Create, Read, Update, and Delete. * <p>The below example demonstrates basic CRUD operations: Create, Read, Update, and Delete.
*/ */
public final class App { public final class App {
private static final Logger log = LoggerFactory.getLogger(App.class); private static Logger log = LoggerFactory.getLogger(App.class);
private static final String STUDENT_STRING = "App.main(), student : "; private static final String STUDENT_STRING = "App.main(), student : ";
/** /**
* Program entry point. * Program entry point.
* *
* @param args command line args. * @param args command line args.
*/ */
public static void main(final String... args) { public static void main(final String... args) {
/* Create new data mapper for type 'first' */ /* Create new data mapper for type 'first' */
final var mapper = new StudentDataMapperImpl(); final var mapper = new StudentDataMapperImpl();
/* Create new student */ /* Create new student */
var student = new Student(1, "Adam", 'A'); var student = new Student(1, "Adam", 'A');
/* Add student in respectibe store */ /* Add student in respectibe store */
mapper.insert(student); mapper.insert(student);
log.debug(STUDENT_STRING + student + ", is inserted"); log.debug(STUDENT_STRING + student + ", is inserted");
/* Find this student */ /* Find this student */
final var studentToBeFound = mapper.find(student.getStudentId()); final var studentToBeFound = mapper.find(student.getStudentId());
log.debug(STUDENT_STRING + studentToBeFound + ", is searched"); log.debug(STUDENT_STRING + studentToBeFound + ", is searched");
/* Update existing student object */ /* Update existing student object */
student = new Student(student.getStudentId(), "AdamUpdated", 'A'); student = new Student(student.getStudentId(), "AdamUpdated", 'A');
/* Update student in respectibe db */ /* Update student in respectibe db */
mapper.update(student); mapper.update(student);
log.debug(STUDENT_STRING + student + ", is updated"); log.debug(STUDENT_STRING + student + ", is updated");
log.debug(STUDENT_STRING + student + ", is going to be deleted"); log.debug(STUDENT_STRING + student + ", is going to be deleted");
/* Delete student in db */ /* Delete student in db */
mapper.delete(student); mapper.delete(student);
} }
private App() { private App() {
} }
} }

View File

@ -33,7 +33,7 @@ import java.util.Optional;
public final class StudentDataMapperImpl implements StudentDataMapper { public final class StudentDataMapperImpl implements StudentDataMapper {
/* Note: Normally this would be in the form of an actual database */ /* Note: Normally this would be in the form of an actual database */
private final List<Student> students = new ArrayList<>(); private List<Student> students = new ArrayList<>();
@Override @Override
public Optional<Student> find(int studentId) { public Optional<Student> find(int studentId) {

View File

@ -64,7 +64,7 @@ Customer resource class acts as the server for customer information.
```java ```java
public class CustomerResource { public class CustomerResource {
private final List<CustomerDto> customers; private List<CustomerDto> customers;
public CustomerResource(List<CustomerDto> customers) { public CustomerResource(List<CustomerDto> customers) {
this.customers = customers; this.customers = customers;

View File

@ -30,7 +30,7 @@ import java.util.List;
* has all customer details. * has all customer details.
*/ */
public class CustomerResource { public class CustomerResource {
private final List<CustomerDto> customers; private List<CustomerDto> customers;
/** /**
* Initialise resource with existing customers. * Initialise resource with existing customers.

View File

@ -70,7 +70,7 @@ public class ClubbedTroll implements Troll {
private static final Logger LOGGER = LoggerFactory.getLogger(ClubbedTroll.class); private static final Logger LOGGER = LoggerFactory.getLogger(ClubbedTroll.class);
private final Troll decorated; private Troll decorated;
public ClubbedTroll(Troll decorated) { public ClubbedTroll(Troll decorated) {
this.decorated = decorated; this.decorated = decorated;

View File

@ -33,7 +33,7 @@ public class ClubbedTroll implements Troll {
private static final Logger LOGGER = LoggerFactory.getLogger(ClubbedTroll.class); private static final Logger LOGGER = LoggerFactory.getLogger(ClubbedTroll.class);
private final Troll decorated; private Troll decorated;
public ClubbedTroll(Troll decorated) { public ClubbedTroll(Troll decorated) {
this.decorated = decorated; this.decorated = decorated;

View File

@ -68,7 +68,7 @@ public class SimpleTrollTest {
private class InMemoryAppender extends AppenderBase<ILoggingEvent> { private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender(Class clazz) { public InMemoryAppender(Class clazz) {
((Logger) LoggerFactory.getLogger(clazz)).addAppender(this); ((Logger) LoggerFactory.getLogger(clazz)).addAppender(this);

View File

@ -86,7 +86,7 @@ public class DelegateTest {
*/ */
private class InMemoryAppender extends AppenderBase<ILoggingEvent> { private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender() { public InMemoryAppender() {
((Logger) LoggerFactory.getLogger("root")).addAppender(this); ((Logger) LoggerFactory.getLogger("root")).addAppender(this);

View File

@ -62,7 +62,7 @@ public interface Wizard {
public class AdvancedWizard implements Wizard { public class AdvancedWizard implements Wizard {
private final Tobacco tobacco; private Tobacco tobacco;
public AdvancedWizard(Tobacco tobacco) { public AdvancedWizard(Tobacco tobacco) {
this.tobacco = tobacco; this.tobacco = tobacco;

View File

@ -29,7 +29,7 @@ package com.iluwatar.dependency.injection;
*/ */
public class AdvancedWizard implements Wizard { public class AdvancedWizard implements Wizard {
private final Tobacco tobacco; private Tobacco tobacco;
public AdvancedWizard(Tobacco tobacco) { public AdvancedWizard(Tobacco tobacco) {
this.tobacco = tobacco; this.tobacco = tobacco;

View File

@ -31,7 +31,7 @@ import javax.inject.Inject;
*/ */
public class GuiceWizard implements Wizard { public class GuiceWizard implements Wizard {
private final Tobacco tobacco; private Tobacco tobacco;
@Inject @Inject
public GuiceWizard(Tobacco tobacco) { public GuiceWizard(Tobacco tobacco) {

View File

@ -29,7 +29,7 @@ package com.iluwatar.dependency.injection;
*/ */
public class SimpleWizard implements Wizard { public class SimpleWizard implements Wizard {
private final OldTobyTobacco tobacco = new OldTobyTobacco(); private OldTobyTobacco tobacco = new OldTobyTobacco();
public void smoke() { public void smoke() {
tobacco.smoke(this); tobacco.smoke(this);

View File

@ -37,7 +37,7 @@ import java.util.List;
*/ */
public class InMemoryAppender extends AppenderBase<ILoggingEvent> { public class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender(Class clazz) { public InMemoryAppender(Class clazz) {
((Logger) LoggerFactory.getLogger(clazz)).addAppender(this); ((Logger) LoggerFactory.getLogger(clazz)).addAppender(this);

View File

@ -34,7 +34,7 @@ import java.util.List;
public class World { public class World {
private List<String> countries; private List<String> countries;
private final DataFetcher df; private DataFetcher df;
public World() { public World() {
this.countries = new ArrayList<String>(); this.countries = new ArrayList<String>();

View File

@ -33,7 +33,7 @@ public class FrameBuffer implements Buffer {
public static final int WIDTH = 10; public static final int WIDTH = 10;
public static final int HEIGHT = 8; public static final int HEIGHT = 8;
private final Pixel[] pixels = new Pixel[WIDTH * HEIGHT]; private Pixel[] pixels = new Pixel[WIDTH * HEIGHT];
public FrameBuffer() { public FrameBuffer() {
clearAll(); clearAll();

View File

@ -31,7 +31,7 @@ public enum Pixel {
WHITE(0), WHITE(0),
BLACK(1); BLACK(1);
private final int color; private int color;
Pixel(int color) { Pixel(int color) {
this.color = color; this.color = color;

View File

@ -35,7 +35,7 @@ public class Scene {
private static final Logger LOGGER = LoggerFactory.getLogger(Scene.class); private static final Logger LOGGER = LoggerFactory.getLogger(Scene.class);
private final Buffer[] frameBuffers; private Buffer[] frameBuffers;
private int current; private int current;

View File

@ -109,7 +109,7 @@ public class InventoryTest {
private class InMemoryAppender extends AppenderBase<ILoggingEvent> { private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender(Class clazz) { public InMemoryAppender(Class clazz) {
((Logger) LoggerFactory.getLogger(clazz)).addAppender(this); ((Logger) LoggerFactory.getLogger(clazz)).addAppender(this);

View File

@ -28,10 +28,10 @@ package com.iluwatar.doubledispatch;
*/ */
public class Rectangle { public class Rectangle {
private final int left; private int left;
private final int top; private int top;
private final int right; private int right;
private final int bottom; private int bottom;
/** /**
* Constructor. * Constructor.

View File

@ -31,7 +31,7 @@ public enum Event {
STARK_SIGHTED("Stark sighted"), WARSHIPS_APPROACHING("Warships approaching"), TRAITOR_DETECTED( STARK_SIGHTED("Stark sighted"), WARSHIPS_APPROACHING("Warships approaching"), TRAITOR_DETECTED(
"Traitor detected"); "Traitor detected");
private final String description; private String description;
Event(String description) { Event(String description) {
this.description = description; this.description = description;

View File

@ -31,7 +31,7 @@ import java.util.List;
*/ */
public abstract class EventEmitter { public abstract class EventEmitter {
private final List<EventObserver> observers; private List<EventObserver> observers;
public EventEmitter() { public EventEmitter() {
observers = new LinkedList<>(); observers = new LinkedList<>();

View File

@ -36,7 +36,7 @@ public enum Weekday {
SATURDAY("Saturday"), SATURDAY("Saturday"),
SUNDAY("Sunday"); SUNDAY("Sunday");
private final String description; private String description;
Weekday(String description) { Weekday(String description) {
this.description = description; this.description = description;

View File

@ -74,7 +74,7 @@ public class KingJoffreyTest {
} }
private class InMemoryAppender extends AppenderBase<ILoggingEvent> { private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender(Class<?> clazz) { public InMemoryAppender(Class<?> clazz) {
((Logger) LoggerFactory.getLogger(clazz)).addAppender(this); ((Logger) LoggerFactory.getLogger(clazz)).addAppender(this);

View File

@ -33,9 +33,9 @@ public class Event implements IEvent, Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(Event.class); private static final Logger LOGGER = LoggerFactory.getLogger(Event.class);
private final int eventId; private int eventId;
private final int eventTime; private int eventTime;
private final boolean isSynchronous; private boolean isSynchronous;
private Thread thread; private Thread thread;
private boolean isComplete = false; private boolean isComplete = false;
private ThreadCompleteListener eventListener; private ThreadCompleteListener eventListener;

View File

@ -43,8 +43,8 @@ public class EventManager implements ThreadCompleteListener {
public static final int MAX_ID = MAX_RUNNING_EVENTS; public static final int MAX_ID = MAX_RUNNING_EVENTS;
public static final int MAX_EVENT_TIME = 1800; // in seconds / 30 minutes. public static final int MAX_EVENT_TIME = 1800; // in seconds / 30 minutes.
private int currentlyRunningSyncEvent = -1; private int currentlyRunningSyncEvent = -1;
private final Random rand; private Random rand;
private final Map<Integer, Event> eventPool; private Map<Integer, Event> eventPool;
private static final String DOES_NOT_EXIST = " does not exist."; private static final String DOES_NOT_EXIST = " does not exist.";

View File

@ -32,7 +32,7 @@ import com.iluwatar.eda.model.User;
*/ */
public class UserCreatedEvent extends AbstractEvent { public class UserCreatedEvent extends AbstractEvent {
private final User user; private User user;
public UserCreatedEvent(User user) { public UserCreatedEvent(User user) {
this.user = user; this.user = user;

View File

@ -32,7 +32,7 @@ import com.iluwatar.eda.model.User;
*/ */
public class UserUpdatedEvent extends AbstractEvent { public class UserUpdatedEvent extends AbstractEvent {
private final User user; private User user;
public UserUpdatedEvent(User user) { public UserUpdatedEvent(User user) {
this.user = user; this.user = user;

View File

@ -32,7 +32,7 @@ import java.util.Map;
*/ */
public class EventDispatcher { public class EventDispatcher {
private final Map<Class<? extends Event>, Handler<? extends Event>> handlers; private Map<Class<? extends Event>, Handler<? extends Event>> handlers;
public EventDispatcher() { public EventDispatcher() {
handlers = new HashMap<>(); handlers = new HashMap<>();

View File

@ -32,7 +32,7 @@ import com.iluwatar.eda.event.UserUpdatedEvent;
*/ */
public class User { public class User {
private final String username; private String username;
public User(String username) { public User(String username) {
this.username = username; this.username = username;

View File

@ -49,7 +49,7 @@ public class Audio {
private volatile Thread updateThread = null; private volatile Thread updateThread = null;
private final PlayMessage[] pendingAudio = new PlayMessage[MAX_PENDING]; private PlayMessage[] pendingAudio = new PlayMessage[MAX_PENDING];
// Visible only for testing purposes // Visible only for testing purposes
Audio() { Audio() {

View File

@ -35,7 +35,7 @@ public class Commander implements CommanderExtension {
private static final Logger LOGGER = LoggerFactory.getLogger(Commander.class); private static final Logger LOGGER = LoggerFactory.getLogger(Commander.class);
private final CommanderUnit unit; private CommanderUnit unit;
public Commander(CommanderUnit commanderUnit) { public Commander(CommanderUnit commanderUnit) {
this.unit = commanderUnit; this.unit = commanderUnit;

View File

@ -35,7 +35,7 @@ public class Sergeant implements SergeantExtension {
private static final Logger LOGGER = LoggerFactory.getLogger(Sergeant.class); private static final Logger LOGGER = LoggerFactory.getLogger(Sergeant.class);
private final SergeantUnit unit; private SergeantUnit unit;
public Sergeant(SergeantUnit sergeantUnit) { public Sergeant(SergeantUnit sergeantUnit) {
this.unit = sergeantUnit; this.unit = sergeantUnit;

View File

@ -34,7 +34,7 @@ import units.SoldierUnit;
public class Soldier implements SoldierExtension { public class Soldier implements SoldierExtension {
private static final Logger LOGGER = LoggerFactory.getLogger(Soldier.class); private static final Logger LOGGER = LoggerFactory.getLogger(Soldier.class);
private final SoldierUnit unit; private SoldierUnit unit;
public Soldier(SoldierUnit soldierUnit) { public Soldier(SoldierUnit soldierUnit) {
this.unit = soldierUnit; this.unit = soldierUnit;

View File

@ -83,7 +83,7 @@ public abstract class DwarvenMineWorker {
public abstract String name(); public abstract String name();
enum Action { static enum Action {
GO_TO_SLEEP, WAKE_UP, GO_HOME, GO_TO_MINE, WORK GO_TO_SLEEP, WAKE_UP, GO_HOME, GO_TO_MINE, WORK
} }
} }

View File

@ -110,7 +110,7 @@ public class DwarvenGoldmineFacadeTest {
private class InMemoryAppender extends AppenderBase<ILoggingEvent> { private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
private final List<ILoggingEvent> log = new LinkedList<>(); private List<ILoggingEvent> log = new LinkedList<>();
public InMemoryAppender() { public InMemoryAppender() {
((Logger) LoggerFactory.getLogger("root")).addAppender(this); ((Logger) LoggerFactory.getLogger("root")).addAppender(this);

View File

@ -32,7 +32,7 @@ import java.util.Map;
*/ */
public class ElfBlacksmith implements Blacksmith { public class ElfBlacksmith implements Blacksmith {
private static final Map<WeaponType, ElfWeapon> ELFARSENAL; private static Map<WeaponType, ElfWeapon> ELFARSENAL;
static { static {
ELFARSENAL = new HashMap<>(WeaponType.values().length); ELFARSENAL = new HashMap<>(WeaponType.values().length);

View File

@ -28,7 +28,7 @@ package com.iluwatar.factory.method;
*/ */
public class ElfWeapon implements Weapon { public class ElfWeapon implements Weapon {
private final WeaponType weaponType; private WeaponType weaponType;
public ElfWeapon(WeaponType weaponType) { public ElfWeapon(WeaponType weaponType) {
this.weaponType = weaponType; this.weaponType = weaponType;

View File

@ -32,7 +32,7 @@ import java.util.Map;
*/ */
public class OrcBlacksmith implements Blacksmith { public class OrcBlacksmith implements Blacksmith {
private static final Map<WeaponType, OrcWeapon> ORCARSENAL; private static Map<WeaponType, OrcWeapon> ORCARSENAL;
static { static {
ORCARSENAL = new HashMap<>(WeaponType.values().length); ORCARSENAL = new HashMap<>(WeaponType.values().length);

View File

@ -28,7 +28,7 @@ package com.iluwatar.factory.method;
*/ */
public class OrcWeapon implements Weapon { public class OrcWeapon implements Weapon {
private final WeaponType weaponType; private WeaponType weaponType;
public OrcWeapon(WeaponType weaponType) { public OrcWeapon(WeaponType weaponType) {
this.weaponType = weaponType; this.weaponType = weaponType;

View File

@ -30,7 +30,7 @@ public enum WeaponType {
SHORT_SWORD("short sword"), SPEAR("spear"), AXE("axe"), UNDEFINED(""); SHORT_SWORD("short sword"), SPEAR("spear"), AXE("axe"), UNDEFINED("");
private final String title; private String title;
WeaponType(String title) { WeaponType(String title) {
this.title = title; this.title = title;

View File

@ -42,7 +42,7 @@ import java.util.Properties;
*/ */
public class PropertiesFeatureToggleVersion implements Service { public class PropertiesFeatureToggleVersion implements Service {
private final boolean isEnhanced; private boolean isEnhanced;
/** /**
* Creates an instance of {@link PropertiesFeatureToggleVersion} using the passed {@link * Creates an instance of {@link PropertiesFeatureToggleVersion} using the passed {@link

View File

@ -29,7 +29,7 @@ package com.iluwatar.featuretoggle.user;
*/ */
public class User { public class User {
private final String name; private String name;
/** /**
* Default Constructor setting the username. * Default Constructor setting the username.

View File

@ -35,8 +35,8 @@ import java.util.List;
*/ */
public class UserGroup { public class UserGroup {
private static final List<User> freeGroup = new ArrayList<>(); private static List<User> freeGroup = new ArrayList<>();
private static final List<User> paidGroup = new ArrayList<>(); private static List<User> paidGroup = new ArrayList<>();
/** /**

View File

@ -94,7 +94,7 @@ public class App {
.filter(positives()) .filter(positives())
.first(4) .first(4)
.last(2) .last(2)
.map(number -> "String[" + number + "]") .map(number -> "String[" + valueOf(number) + "]")
.asList(); .asList();
prettyPrint("The lazy list contains the last two of the first four positive numbers " prettyPrint("The lazy list contains the last two of the first four positive numbers "
+ "mapped to Strings: ", lastTwoOfFirstFourStringMapped); + "mapped to Strings: ", lastTwoOfFirstFourStringMapped);

View File

@ -198,7 +198,7 @@ public class LazyFluentIterable<E> implements FluentIterable<E> {
@Override @Override
public Iterator<T> iterator() { public Iterator<T> iterator() {
return new DecoratingIterator<T>(null) { return new DecoratingIterator<T>(null) {
final Iterator<E> oldTypeIterator = iterable.iterator(); Iterator<E> oldTypeIterator = iterable.iterator();
@Override @Override
public T computeNext() { public T computeNext() {

View File

@ -28,7 +28,7 @@ package com.iluwatar.flux.action;
*/ */
public abstract class Action { public abstract class Action {
private final ActionType type; private ActionType type;
public Action(ActionType type) { public Action(ActionType type) {
this.type = type; this.type = type;

View File

@ -28,6 +28,6 @@ package com.iluwatar.flux.action;
*/ */
public enum ActionType { public enum ActionType {
MENU_ITEM_SELECTED, CONTENT_CHANGED MENU_ITEM_SELECTED, CONTENT_CHANGED;
} }

View File

@ -31,7 +31,7 @@ public enum Content {
PRODUCTS("Products - This page lists the company's products."), COMPANY( PRODUCTS("Products - This page lists the company's products."), COMPANY(
"Company - This page displays information about the company."); "Company - This page displays information about the company.");
private final String title; private String title;
Content(String title) { Content(String title) {
this.title = title; this.title = title;

View File

@ -28,7 +28,7 @@ package com.iluwatar.flux.action;
*/ */
public class ContentAction extends Action { public class ContentAction extends Action {
private final Content content; private Content content;
public ContentAction(Content content) { public ContentAction(Content content) {
super(ActionType.CONTENT_CHANGED); super(ActionType.CONTENT_CHANGED);

View File

@ -29,7 +29,7 @@ package com.iluwatar.flux.action;
*/ */
public class MenuAction extends Action { public class MenuAction extends Action {
private final MenuItem menuItem; private MenuItem menuItem;
public MenuAction(MenuItem menuItem) { public MenuAction(MenuItem menuItem) {
super(ActionType.MENU_ITEM_SELECTED); super(ActionType.MENU_ITEM_SELECTED);

View File

@ -30,7 +30,7 @@ public enum MenuItem {
HOME("Home"), PRODUCTS("Products"), COMPANY("Company"); HOME("Home"), PRODUCTS("Products"), COMPANY("Company");
private final String title; private String title;
MenuItem(String title) { MenuItem(String title) {
this.title = title; this.title = title;

View File

@ -39,7 +39,7 @@ public final class Dispatcher {
private static Dispatcher instance = new Dispatcher(); private static Dispatcher instance = new Dispatcher();
private final List<Store> stores = new LinkedList<>(); private List<Store> stores = new LinkedList<>();
private Dispatcher() { private Dispatcher() {
} }

View File

@ -33,7 +33,7 @@ import java.util.List;
*/ */
public abstract class Store { public abstract class Store {
private final List<View> views = new LinkedList<>(); private List<View> views = new LinkedList<>();
public abstract void onAction(Action action); public abstract void onAction(Action action);

Some files were not shown because too many files have changed in this diff Show More