core-android/src/main/java/com/uber/sdk/android/core/auth/AuthUtils.java
@NonNull
    static Collection<Scope> stringToScopeCollection(@NonNull String scopesString) throws IllegalArgumentException {
        Set<Scope> scopeCollection = new HashSet<>();

        if (scopesString.isEmpty()) {
            return scopeCollection;
        }

        String[] scopeStrings = scopesString.split(" ");
        for (String scopeName : scopeStrings) {
            try {
                scopeCollection.add(Scope.valueOf(scopeName.toUpperCase()));
            } catch (IllegalArgumentException e) {
                // do nothing, will omit custom or bad scopes
            }
        }

        return scopeCollection;
    }
@NonNull
    static Collection<Scope> stringToScopeCollection(@NonNull String scopesString) throws IllegalArgumentException {
        Set<Scope> scopeCollection = new HashSet<>();

        if (scopesString.isEmpty()) {
            return scopeCollection;
        }

        String[] scopeStrings = scopesString.split(" ");
        for (String scopeName : scopeStrings) {
            try {
                scopeCollection.add(Scope.valueOf(scopeName.toUpperCase()));
            } catch (IllegalArgumentException e) {
                // do nothing, will omit custom or bad scopes
            }
        }

        return scopeCollection;
    }
@ NonNull static Collection < Scope > stringToScopeCollection ( @ NonNull String scopesString ) throws IllegalArgumentException { Set < Scope > scopeCollection = new HashSet <> ( ) ; if ( scopesString . isEmpty ( ) ) { return scopeCollection ; } String [ ] scopeStrings = scopesString . split ( " " ) ; for ( String scopeName : scopeStrings ) { try { scopeCollection . add ( Scope . valueOf ( scopeName . toUpperCase ( ) ) ) ; } catch ( IllegalArgumentException e ) { // do nothing, will omit custom or bad scopes } } return scopeCollection ; }
Converts a {@link String} representing space delimited {@link Scope}s to a {@link Collection<Scope>}.

@param scopesString the {@link String} to convert.
@return a {@link Collection} of {@link Scope}s.
@throws IllegalArgumentException if a part of the string doesn't match a scope name.
Converts a { @link String } representing space delimited { @link Scope } s to a { @link Collection<Scope > } .