Open ivangreene opened 5 years ago
See #178 for some background on the reason for this: currently, to inspect a JsonObjectBuilder while still adding values to it, one must do something such as the following to obtain a JsonObject to inspect values of:
public static JsonObject buildWithoutClearing(JsonObjectBuilder jsonObjectBuilder) {
JsonObject built = jsonObjectBuilder.build();
JsonObjectBuilder clone = Json.createObjectBuilder(built);
jsonObjectBuilder.addAll(clone);
return built;
}
At times, it may be useful to inspect a JsonObjectBuilder without needing to build it (such as determining whether or not the object contains a particular key, for example). Methods could be provided on JsonObjectBuilder to examine the state of the underlying JsonObject to be built