@Override public Iterator<JsonField> iterator() { return wrapped.iterator(); }
@Override public Iterator<JsonField> iterator() { return wrapped.iterator(); }
@Override public Iterator<JsonField> iterator() { return wrapped.iterator(); }
@Override public Iterator<JsonField> iterator() { return wrapped.iterator(); }
/** * Creates a new {@link StatusDetailMessage} from a JSON object. * * @param jsonObject the JSON object. * @return the message. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} is empty. * @throws JsonMissingFieldException if the passed in {@code jsonObject} was not in the expected format. */ public static StatusDetailMessage fromJson(final JsonObject jsonObject) { if (jsonObject.getSize() != 1) { throw new JsonParseException("Message must contain exactly one field, but does not:\n" + jsonObject); } final JsonField messageField = jsonObject.iterator().next(); final Level level = Level.valueOf(messageField.getKeyName()); final JsonValue message = messageField.getValue(); return of(level, message); }
/** * Creates a new {@link StatusDetailMessage} from a JSON object. * * @param jsonObject the JSON object. * @return the message. * @throws NullPointerException if {@code jsonObject} is {@code null}. * @throws IllegalArgumentException if {@code jsonObject} is empty. * @throws JsonMissingFieldException if the passed in {@code jsonObject} was not in the expected format. */ public static StatusDetailMessage fromJson(final JsonObject jsonObject) { if (jsonObject.getSize() != 1) { throw new JsonParseException("Message must contain exactly one field, but does not:\n" + jsonObject); } final JsonField messageField = jsonObject.iterator().next(); final Level level = Level.valueOf(messageField.getKeyName()); final JsonValue message = messageField.getValue(); return of(level, message); }