Gets the given JsonElement as a JsonArray. Expects the second parameter to be the name of the element's field if an error message needs to be thrown.
(JsonElement p_151207_0_, String p_151207_1_)
| 256 | * an error message needs to be thrown. |
| 257 | */ |
| 258 | public static JsonArray getJsonArray(JsonElement p_151207_0_, String p_151207_1_) |
| 259 | { |
| 260 | if (p_151207_0_.isJsonArray()) |
| 261 | { |
| 262 | return p_151207_0_.getAsJsonArray(); |
| 263 | } |
| 264 | else |
| 265 | { |
| 266 | throw new JsonSyntaxException("Expected " + p_151207_1_ + " to be a JsonArray, was " + toString(p_151207_0_)); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | /** |
| 271 | * Gets the JsonArray field on the JsonObject with the given name. |
no test coverage detected