@NotThreadSafe public class Scope extends LinkedHashSet<Scope.Value>
Example scope from OpenID Connect indicating access to the user's email and profile details:
Scope scope = new Scope(); scope.add(OIDCScopeValue.OPENID); scope.add(OIDCScopeValue.EMAIL); scope.add(OIDCScopeValue.PROFILE);
Related specifications:
| Modifier and Type | Class and Description |
|---|---|
static class |
Scope.Value
Authorisation scope value.
|
| Constructor and Description |
|---|
Scope()
Creates a new empty authorisation scope.
|
Scope(Scope.Value... values)
Creates a new authorisation scope with the specified values.
|
Scope(Scope scope)
Creates a new scope from the specified scope.
|
Scope(String... values)
Creates a new authorisation scope with the specified string values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String value)
Adds the specified string value to this scope.
|
boolean |
contains(String value)
Checks if this scope contains the specified string value.
|
static Scope |
parse(Collection<String> collection)
Parses a scope from the specified string collection representation.
|
static Scope |
parse(String s)
Parses a scope from the specified string representation.
|
String |
toString()
Returns the string representation of this scope.
|
List<String> |
toStringList()
Returns the string list representation of this scope.
|
spliteratoradd, clear, clone, contains, isEmpty, iterator, remove, sizeequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArrayfinalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayparallelStream, removeIf, streampublic Scope()
public Scope(Scope scope)
scope - The scope. May be null.public Scope(String... values)
values - The string values.public Scope(Scope.Value... values)
values - The values.public boolean add(String value)
value - The string value. Must not be null.true if this scope did not already contain the
specified value.public boolean contains(String value)
value - The string value. Must not be null.true if the value is contained, else false.public String toString()
toString in class AbstractCollection<Scope.Value>public List<String> toStringList()
public static Scope parse(Collection<String> collection)
collection - The string collection, null if not
specified.null if not specified.Copyright © 2016 Connect2id Ltd.. All rights reserved.