|
10 | 10 | import java.util.function.Predicate; |
11 | 11 | import java.util.stream.Stream; |
12 | 12 |
|
| 13 | +import static alpine.json.Element.*; |
| 14 | + |
13 | 15 | /** |
14 | 16 | * A JSON element which stores a collection of key-value pairs where the keys are strings. |
15 | 17 | * @see <a href="https://datatracker.ietf.org/doc/html/rfc8259#section-4">RFC 8259</a> |
@@ -181,16 +183,16 @@ public boolean hasValue(Element value) { |
181 | 183 | return this.elements.containsValue(value); |
182 | 184 | } |
183 | 185 |
|
184 | | - public boolean hasValue(String value) { |
185 | | - return this.hasValue(Element.string(value)); |
| 186 | + public boolean hasValue(boolean value) { |
| 187 | + return this.hasValue(bool(value)); |
186 | 188 | } |
187 | 189 |
|
188 | 190 | public boolean hasValue(Number value) { |
189 | | - return this.hasValue(Element.number(value)); |
| 191 | + return this.hasValue(number(value)); |
190 | 192 | } |
191 | 193 |
|
192 | | - public boolean hasValue(Boolean value) { |
193 | | - return this.hasValue(Element.bool(value)); |
| 194 | + public boolean hasValue(String value) { |
| 195 | + return this.hasValue(string(value)); |
194 | 196 | } |
195 | 197 |
|
196 | 198 | public void each(BiConsumer<String, Element> consumer) { |
@@ -268,15 +270,15 @@ public ObjectElement set(String key, Element value) { |
268 | 270 | } |
269 | 271 |
|
270 | 272 | public ObjectElement set(String key, boolean value) { |
271 | | - return this.set(key, Element.bool(value)); |
| 273 | + return this.set(key, bool(value)); |
272 | 274 | } |
273 | 275 |
|
274 | 276 | public ObjectElement set(String key, Number value) { |
275 | | - return this.set(key, Element.number(value)); |
| 277 | + return this.set(key, number(value)); |
276 | 278 | } |
277 | 279 |
|
278 | 280 | public ObjectElement set(String key, String value) { |
279 | | - return this.set(key, Element.string(value)); |
| 281 | + return this.set(key, string(value)); |
280 | 282 | } |
281 | 283 |
|
282 | 284 | public ObjectElement remove(String key) { |
|
0 commit comments