public static ScopeType getScopeType(final String scope) { ScopeType result = null; if (scope != null) { for (ScopeType type : ScopeType.values()) { if (type.getScope().equalsIgnoreCase(scope.trim())) { result = type; } } } return result; }