-
- All Implemented Interfaces:
public final class ExtensionKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends JSONValue> JSONRef<T>ptr(JSONValue $self, JSONPointer pointer)Create a JSONRef from thisJSONValue and the specified JSONPointer.final static <T extends JSONValue> UnitifPresent(JSONRef<JSONObject> $self, String name, Function2<JSONRef<T>, T, Unit> block)Conditionally execute if JSONObject referenced by thisJSONRef contains a member with the specified key and the expected type.final static <T extends JSONValue> UnitforEachKey(JSONRef<JSONObject> $self, Function2<JSONRef<T>, String, Unit> block)Iterate over the members of the JSONObject referenced by thisJSONRef.final static <T extends JSONValue> UnitforEach(JSONRef<JSONArray> $self, Function2<JSONRef<T>, Integer, Unit> block)Iterate over the members of the JSONArray referenced by thisJSONRef.final static <Q extends JSONValue> JSONRef<Q>child(JSONRef<JSONObject> $self, String name)Get the named child reference (strongly typed) from this JSONObject reference, using the implied child type. final static <T extends JSONValue> JSONRef<T>child(JSONRef<JSONObject> $self, KClass<T> childClass, String name, Boolean nullable)Get the named child reference (strongly typed) from this JSONObject reference, using the supplied child class and nullability. final static <Q extends JSONValue> JSONRef<Q>child(JSONRef<JSONArray> $self, Integer index)Get the named child reference (strongly typed) from this JSONArray reference, using the implied child type. final static <T extends JSONValue> JSONRef<T>child(JSONRef<JSONArray> $self, KClass<T> childClass, Integer index, Boolean nullable)Get the named child reference (strongly typed) from this JSONArray reference, using the supplied child class and nullability. final static JSONRef<JSONValue>untypedChild(JSONRef<JSONObject> $self, String name)Get the named child reference (untyped) from this JSONObject reference. final static JSONRef<JSONValue>untypedChild(JSONRef<JSONArray> $self, Integer index)Get the named child reference (untyped) from this JSONArray reference. final static <T extends JSONValue> BooleanhasChild(JSONRef<JSONObject> $self, String name)Test whether this JSONObject reference has the named child. final static <T extends JSONValue> BooleanhasChild(JSONRef<JSONArray> $self, Integer index)Test whether this JSONArray reference has a child at the given index. -
-
Method Detail
-
ptr
final static <T extends JSONValue> JSONRef<T> ptr(JSONValue $self, JSONPointer pointer)
Create a JSONRef from
thisJSONValue and the specified JSONPointer.
-
ifPresent
final static <T extends JSONValue> Unit ifPresent(JSONRef<JSONObject> $self, String name, Function2<JSONRef<T>, T, Unit> block)
Conditionally execute if JSONObject referenced by
thisJSONRef contains a member with the specified key and the expected type.
-
forEachKey
final static <T extends JSONValue> Unit forEachKey(JSONRef<JSONObject> $self, Function2<JSONRef<T>, String, Unit> block)
Iterate over the members of the JSONObject referenced by
thisJSONRef.
-
forEach
final static <T extends JSONValue> Unit forEach(JSONRef<JSONArray> $self, Function2<JSONRef<T>, Integer, Unit> block)
Iterate over the members of the JSONArray referenced by
thisJSONRef.
-
child
final static <Q extends JSONValue> JSONRef<Q> child(JSONRef<JSONObject> $self, String name)
Get the named child reference (strongly typed) from this JSONObject reference, using the implied child type.
-
child
final static <T extends JSONValue> JSONRef<T> child(JSONRef<JSONObject> $self, KClass<T> childClass, String name, Boolean nullable)
Get the named child reference (strongly typed) from this JSONObject reference, using the supplied child class and nullability.
-
child
final static <Q extends JSONValue> JSONRef<Q> child(JSONRef<JSONArray> $self, Integer index)
Get the named child reference (strongly typed) from this JSONArray reference, using the implied child type.
-
child
final static <T extends JSONValue> JSONRef<T> child(JSONRef<JSONArray> $self, KClass<T> childClass, Integer index, Boolean nullable)
Get the named child reference (strongly typed) from this JSONArray reference, using the supplied child class and nullability.
-
untypedChild
final static JSONRef<JSONValue> untypedChild(JSONRef<JSONObject> $self, String name)
Get the named child reference (untyped) from this JSONObject reference.
-
untypedChild
final static JSONRef<JSONValue> untypedChild(JSONRef<JSONArray> $self, Integer index)
Get the named child reference (untyped) from this JSONArray reference.
-
hasChild
final static <T extends JSONValue> Boolean hasChild(JSONRef<JSONObject> $self, String name)
Test whether this JSONObject reference has the named child.
-
-
-
-