/** * Resolves a key that was returned from {@link #getKey()} to a {@link RequestStatusState}. For backwards * compatibility, it resolves the key "notfound" to {@link #NOT_FOUND}. */ public static RequestStatusState fromKey(String key) { try { return RequestStatusState.valueOf(key.toUpperCase(Locale.ENGLISH)); } catch (final IllegalArgumentException e) { if (key.equalsIgnoreCase(RequestStatusState.NOT_FOUND.getKey())) { return RequestStatusState.NOT_FOUND; } else { throw e; } } }