Package rife.json

Interface JsonObjectAction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JsonObjectAction
Captures an action that has to be executed on a JsonObject instance.

There's no need to implement this interface directly since it's intended to be provided as an inline lambda to JsonObject.object(String, JsonObjectAction) and JsonArray.object(JsonObjectAction). Those methods will construct a nested JSON object, hand it to the action so that you can populate it, and attach it to the enclosing structure afterwards.

Since:
1.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the action on the specified JsonObject instance.
  • Method Details

    • use

      void use(JsonObject o)
      Executes the action on the specified JsonObject instance.

      The JSON object that is handed to you has already been created, so that you only have to populate it.

      Parameters:
      o - the JsonObject instance on which to execute the action
      Since:
      1.10