class StatusDetailMessage implements Jsonifiable<JsonObject> {

    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);
    }

    private  StatusDetailMessage(final Level level, final JsonValue message);

}