Gets the boolean value of the given JsonElement. Expects the second parameter to be the name of the element's field if an error message needs to be thrown.
(JsonElement p_151216_0_, String p_151216_1_)
| 99 | * field if an error message needs to be thrown. |
| 100 | */ |
| 101 | public static boolean getBoolean(JsonElement p_151216_0_, String p_151216_1_) |
| 102 | { |
| 103 | if (p_151216_0_.isJsonPrimitive()) |
| 104 | { |
| 105 | return p_151216_0_.getAsBoolean(); |
| 106 | } |
| 107 | else |
| 108 | { |
| 109 | throw new JsonSyntaxException("Expected " + p_151216_1_ + " to be a Boolean, was " + toString(p_151216_0_)); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Gets the boolean value of the field on the JsonObject with the given name. |
no test coverage detected