public boolean isApplicationKeyCorrupted(String key) { return !ApplicationKey.isValid(key); } }
private ApplicationKey(final String key) { if (!isValid(key)) { throw new IllegalArgumentException("'key' must match the regular expression '" + ALLOWED_KEYS + "'."); } this.key = key; }
if (!ApplicationKey.isValid(applicationKeyStr))
/** * Gets an ApplicationRole from the provided key * * @param key the key of the ApplicationRole to retrieve * @return an ApplicationRole or a ResponseBuilder containing an error response */ private Either<Response.ResponseBuilder, ApplicationRole> getApplicationRole(String key) { if (!ApplicationKey.isValid(key)) { return Either.left(forError(helper.getText("application.role.rest.bad.key", key))); } final ServiceOutcome<ApplicationRole> outcome = service.getRole(ApplicationKey.valueOf(key)); if (!outcome.isValid()) { return Either.left(forCollection(outcome.getErrorCollection())); } return Either.right(outcome.get()); }