Class ExtensionKt

  • All Implemented Interfaces:

    
    public final class ExtensionKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends JSONValue> JSONRef<T> ptr(JSONValue $self, JSONPointer pointer) Create a JSONRef from this JSONValue and the specified JSONPointer.
      final static <T extends JSONValue> Unit ifPresent(JSONRef<JSONObject> $self, String name, Function2<JSONRef<T>, T, Unit> block) Conditionally execute if JSONObject referenced by this JSONRef contains a member with the specified key and the expected type.
      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 this JSONRef.
      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 this JSONRef.
      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> Boolean hasChild(JSONRef<JSONObject> $self, String name) Test whether this JSONObject reference has the named child.
      final static <T extends JSONValue> Boolean hasChild(JSONRef<JSONArray> $self, Integer index) Test whether this JSONArray reference has a child at the given index.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • 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 this JSONRef contains a member with the specified key and the expected type.

      • 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.

      • hasChild

         final static <T extends JSONValue> Boolean hasChild(JSONRef<JSONArray> $self, Integer index)

        Test whether this JSONArray reference has a child at the given index.