Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/a-cordier/design-pattern-ngleton
Provide n ready made instances of an object using static final references and a private constructor
https://github.com/a-cordier/design-pattern-ngleton
Last synced: 14 days ago
JSON representation
Provide n ready made instances of an object using static final references and a private constructor
- Host: GitHub
- URL: https://github.com/a-cordier/design-pattern-ngleton
- Owner: a-cordier
- Created: 2016-01-27T10:23:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-27T10:23:59.000Z (almost 9 years ago)
- Last Synced: 2024-10-10T20:58:53.724Z (about 1 month ago)
- Language: Java
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# "NGleton" using static final instances
# Provide n ready made instances of an object using static final references and a private constructor
```java
private String name;
private Integer value;
public static final NGleton instanceOne =
new NGleton("One", 1);
public static final NGleton instanceTwo =
new NGleton("two", 2);
private NGleton(String name, Integer value) {
this.name = name;
this.value = value;
}
```