Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 36c8534

Browse files
committed
Removes getInstance from singletons
1 parent 2df8285 commit 36c8534

File tree

108 files changed

+64
-1153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+64
-1153
lines changed

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java

-9
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extend
7777
7878
Do not edit the class manually.
7979
*/
80-
private static AdditionalpropertiesAllowsASchemaWhichShouldValidate1 instance;
81-
8280
protected AdditionalpropertiesAllowsASchemaWhichShouldValidate1() {
8381
super(new JsonSchemaInfo()
8482
.type(Set.of(FrozenMap.class))
@@ -89,13 +87,6 @@ protected AdditionalpropertiesAllowsASchemaWhichShouldValidate1() {
8987
.additionalProperties(AdditionalProperties.class)
9088
);
9189
}
92-
93-
public static AdditionalpropertiesAllowsASchemaWhichShouldValidate1 getInstance() {
94-
if (instance == null) {
95-
instance = new AdditionalpropertiesAllowsASchemaWhichShouldValidate1();
96-
}
97-
return instance;
98-
}
9990

10091
@Override
10192
public FrozenMap<Object> castToAllowedTypes(Map<String, Object> arg, List<Object> pathToItem, Set<List<Object>> pathSet) {

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java

-9
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema
8282
8383
Do not edit the class manually.
8484
*/
85-
private static AdditionalpropertiesAreAllowedByDefault1 instance;
86-
8785
protected AdditionalpropertiesAreAllowedByDefault1() {
8886
super(new JsonSchemaInfo()
8987
.properties(Map.ofEntries(
@@ -92,13 +90,6 @@ protected AdditionalpropertiesAreAllowedByDefault1() {
9290
))
9391
);
9492
}
95-
96-
public static AdditionalpropertiesAreAllowedByDefault1 getInstance() {
97-
if (instance == null) {
98-
instance = new AdditionalpropertiesAreAllowedByDefault1();
99-
}
100-
return instance;
101-
}
10293
@Override
10394
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
10495
return castToAllowedVoidTypes(arg, pathToItem, pathSet);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java

-9
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,12 @@ public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema imp
5454
5555
Do not edit the class manually.
5656
*/
57-
private static AdditionalpropertiesCanExistByItself1 instance;
58-
5957
protected AdditionalpropertiesCanExistByItself1() {
6058
super(new JsonSchemaInfo()
6159
.type(Set.of(FrozenMap.class))
6260
.additionalProperties(AdditionalProperties.class)
6361
);
6462
}
65-
66-
public static AdditionalpropertiesCanExistByItself1 getInstance() {
67-
if (instance == null) {
68-
instance = new AdditionalpropertiesCanExistByItself1();
69-
}
70-
return instance;
71-
}
7263

7364
@Override
7465
public FrozenMap<Boolean> castToAllowedTypes(Map<String, Boolean> arg, List<Object> pathToItem, Set<List<Object>> pathSet) {

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java

-18
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,13 @@ public static class Schema0MapInput {
7171

7272

7373
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, Schema0Map> {
74-
private static Schema0 instance;
75-
7674
protected Schema0() {
7775
super(new JsonSchemaInfo()
7876
.properties(Map.ofEntries(
7977
new PropertyEntry("foo", Foo.class)
8078
))
8179
);
8280
}
83-
84-
public static Schema0 getInstance() {
85-
if (instance == null) {
86-
instance = new Schema0();
87-
}
88-
return instance;
89-
}
9081
@Override
9182
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
9283
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -323,8 +314,6 @@ public static class AdditionalpropertiesShouldNotLookInApplicators1 extends Json
323314
324315
Do not edit the class manually.
325316
*/
326-
private static AdditionalpropertiesShouldNotLookInApplicators1 instance;
327-
328317
protected AdditionalpropertiesShouldNotLookInApplicators1() {
329318
super(new JsonSchemaInfo()
330319
.additionalProperties(AdditionalProperties.class)
@@ -333,13 +322,6 @@ protected AdditionalpropertiesShouldNotLookInApplicators1() {
333322
))
334323
);
335324
}
336-
337-
public static AdditionalpropertiesShouldNotLookInApplicators1 getInstance() {
338-
if (instance == null) {
339-
instance = new AdditionalpropertiesShouldNotLookInApplicators1();
340-
}
341-
return instance;
342-
}
343325
@Override
344326
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
345327
return castToAllowedVoidTypes(arg, pathToItem, pathSet);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java

-27
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ public static class Schema0MapInput {
6565

6666

6767
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, Schema0Map> {
68-
private static Schema0 instance;
69-
7068
protected Schema0() {
7169
super(new JsonSchemaInfo()
7270
.properties(Map.ofEntries(
@@ -77,13 +75,6 @@ protected Schema0() {
7775
))
7876
);
7977
}
80-
81-
public static Schema0 getInstance() {
82-
if (instance == null) {
83-
instance = new Schema0();
84-
}
85-
return instance;
86-
}
8778
@Override
8879
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
8980
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -324,8 +315,6 @@ public static class Schema1MapInput {
324315

325316

326317
public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, Schema1Map> {
327-
private static Schema1 instance;
328-
329318
protected Schema1() {
330319
super(new JsonSchemaInfo()
331320
.properties(Map.ofEntries(
@@ -336,13 +325,6 @@ protected Schema1() {
336325
))
337326
);
338327
}
339-
340-
public static Schema1 getInstance() {
341-
if (instance == null) {
342-
instance = new Schema1();
343-
}
344-
return instance;
345-
}
346328
@Override
347329
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
348330
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -559,8 +541,6 @@ public static class Allof1 extends JsonSchema implements NullSchemaValidator, Bo
559541
560542
Do not edit the class manually.
561543
*/
562-
private static Allof1 instance;
563-
564544
protected Allof1() {
565545
super(new JsonSchemaInfo()
566546
.allOf(List.of(
@@ -569,13 +549,6 @@ protected Allof1() {
569549
))
570550
);
571551
}
572-
573-
public static Allof1 getInstance() {
574-
if (instance == null) {
575-
instance = new Allof1();
576-
}
577-
return instance;
578-
}
579552
@Override
580553
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
581554
return castToAllowedVoidTypes(arg, pathToItem, pathSet);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java

-36
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,11 @@ public class AllofCombinedWithAnyofOneof {
3333

3434

3535
public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, FrozenMap<Object>> {
36-
private static Schema02 instance;
37-
3836
protected Schema02() {
3937
super(new JsonSchemaInfo()
4038
.multipleOf(new BigDecimal("2"))
4139
);
4240
}
43-
44-
public static Schema02 getInstance() {
45-
if (instance == null) {
46-
instance = new Schema02();
47-
}
48-
return instance;
49-
}
5041
@Override
5142
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
5243
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -246,20 +237,11 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
246237
}
247238

248239
public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, FrozenMap<Object>> {
249-
private static Schema01 instance;
250-
251240
protected Schema01() {
252241
super(new JsonSchemaInfo()
253242
.multipleOf(new BigDecimal("3"))
254243
);
255244
}
256-
257-
public static Schema01 getInstance() {
258-
if (instance == null) {
259-
instance = new Schema01();
260-
}
261-
return instance;
262-
}
263245
@Override
264246
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
265247
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -459,20 +441,11 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
459441
}
460442

461443
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, FrozenMap<Object>> {
462-
private static Schema0 instance;
463-
464444
protected Schema0() {
465445
super(new JsonSchemaInfo()
466446
.multipleOf(new BigDecimal("5"))
467447
);
468448
}
469-
470-
public static Schema0 getInstance() {
471-
if (instance == null) {
472-
instance = new Schema0();
473-
}
474-
return instance;
475-
}
476449
@Override
477450
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
478451
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -678,8 +651,6 @@ public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements N
678651
679652
Do not edit the class manually.
680653
*/
681-
private static AllofCombinedWithAnyofOneof1 instance;
682-
683654
protected AllofCombinedWithAnyofOneof1() {
684655
super(new JsonSchemaInfo()
685656
.allOf(List.of(
@@ -693,13 +664,6 @@ protected AllofCombinedWithAnyofOneof1() {
693664
))
694665
);
695666
}
696-
697-
public static AllofCombinedWithAnyofOneof1 getInstance() {
698-
if (instance == null) {
699-
instance = new AllofCombinedWithAnyofOneof1();
700-
}
701-
return instance;
702-
}
703667
@Override
704668
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
705669
return castToAllowedVoidTypes(arg, pathToItem, pathSet);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java

-27
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,11 @@ public class AllofSimpleTypes {
3232

3333

3434
public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, FrozenMap<Object>> {
35-
private static Schema0 instance;
36-
3735
protected Schema0() {
3836
super(new JsonSchemaInfo()
3937
.maximum(30)
4038
);
4139
}
42-
43-
public static Schema0 getInstance() {
44-
if (instance == null) {
45-
instance = new Schema0();
46-
}
47-
return instance;
48-
}
4940
@Override
5041
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
5142
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -245,20 +236,11 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
245236
}
246237

247238
public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<Object, Object, FrozenList<Object>>, MapSchemaValidator<Object, Object, FrozenMap<Object>> {
248-
private static Schema1 instance;
249-
250239
protected Schema1() {
251240
super(new JsonSchemaInfo()
252241
.minimum(20)
253242
);
254243
}
255-
256-
public static Schema1 getInstance() {
257-
if (instance == null) {
258-
instance = new Schema1();
259-
}
260-
return instance;
261-
}
262244
@Override
263245
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
264246
return castToAllowedVoidTypes(arg, pathToItem, pathSet);
@@ -464,8 +446,6 @@ public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaVa
464446
465447
Do not edit the class manually.
466448
*/
467-
private static AllofSimpleTypes1 instance;
468-
469449
protected AllofSimpleTypes1() {
470450
super(new JsonSchemaInfo()
471451
.allOf(List.of(
@@ -474,13 +454,6 @@ protected AllofSimpleTypes1() {
474454
))
475455
);
476456
}
477-
478-
public static AllofSimpleTypes1 getInstance() {
479-
if (instance == null) {
480-
instance = new AllofSimpleTypes1();
481-
}
482-
return instance;
483-
}
484457
@Override
485458
public Void castToAllowedTypes(Void arg, List<Object> pathToItem, Set<List<Object>> pathSet) {
486459
return castToAllowedVoidTypes(arg, pathToItem, pathSet);

0 commit comments

Comments
 (0)