Gets the integer 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_151215_0_, String p_151215_1_)
| 179 | * field if an error message needs to be thrown. |
| 180 | */ |
| 181 | public static int getInt(JsonElement p_151215_0_, String p_151215_1_) |
| 182 | { |
| 183 | if (p_151215_0_.isJsonPrimitive() && p_151215_0_.getAsJsonPrimitive().isNumber()) |
| 184 | { |
| 185 | return p_151215_0_.getAsInt(); |
| 186 | } |
| 187 | else |
| 188 | { |
| 189 | throw new JsonSyntaxException("Expected " + p_151215_1_ + " to be a Int, was " + toString(p_151215_0_)); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * Gets the integer value of the field on the JsonObject with the given name. |
no test coverage detected