File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
core/src/main/java/org/everit/json/schema Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 6
6
import java .util .ArrayList ;
7
7
import java .util .Objects ;
8
8
import java .util .List ;
9
-
9
+ import java .util .Set ;
10
+ import java .util .stream .Collectors ;
10
11
import org .everit .json .schema .internal .JSONPrinter ;
11
12
import org .json .JSONArray ;
12
13
import org .json .JSONObject ;
@@ -53,6 +54,11 @@ public Builder possibleValues(List<Object> possibleValues) {
53
54
this .possibleValues = possibleValues ;
54
55
return this ;
55
56
}
57
+
58
+ public Builder possibleValues (Set <Object > possibleValues ) {
59
+ this .possibleValues = possibleValues .stream ().collect (toList ());
60
+ return this ;
61
+ }
56
62
}
57
63
58
64
public static Builder builder () {
@@ -66,7 +72,11 @@ public EnumSchema(Builder builder) {
66
72
possibleValues = Collections .unmodifiableList (toJavaValues (builder .possibleValues ));
67
73
}
68
74
69
- public List <Object > getPossibleValues () {
75
+ public Set <Object > getPossibleValues () {
76
+ return possibleValues .stream ().collect (Collectors .toSet ());
77
+ }
78
+
79
+ public List <Object > getPossibleValuesAsList () {
70
80
return possibleValues ;
71
81
}
72
82
You can’t perform that action at this time.
0 commit comments