Gets the string 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_151206_0_, String p_151206_1_)
| 59 | * field if an error message needs to be thrown. |
| 60 | */ |
| 61 | public static String getString(JsonElement p_151206_0_, String p_151206_1_) |
| 62 | { |
| 63 | if (p_151206_0_.isJsonPrimitive()) |
| 64 | { |
| 65 | return p_151206_0_.getAsString(); |
| 66 | } |
| 67 | else |
| 68 | { |
| 69 | throw new JsonSyntaxException("Expected " + p_151206_1_ + " to be a string, was " + toString(p_151206_0_)); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Gets the string value of the field on the JsonObject with the given name. |
no test coverage detected