Serializable
, Cloneable
, Iterable<Scope.Value>
, Collection<Scope.Value>
, Set<Scope.Value>
@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 | Description |
---|---|---|
static class |
Scope.Value |
Authorisation scope value.
|
Constructor | Description |
---|---|
Scope() |
Creates a new empty authorisation scope.
|
Scope(Scope scope) |
Creates a new scope from the specified scope.
|
Scope(Scope.Value... values) |
Creates a new authorisation scope with the specified values.
|
Scope(String... values) |
Creates a new authorisation scope with the specified string values.
|
Modifier and Type | Method | 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(String s) |
Parses a scope from the specified string representation.
|
static Scope |
parse(Collection<String> collection) |
Parses a scope from the specified string collection representation.
|
String |
toString() |
Returns the string representation of this scope.
|
List<String> |
toStringList() |
Returns the string list representation of this scope.
|
addAll, containsAll, retainAll, toArray, toArray
equals, hashCode, removeAll
parallelStream, removeIf, stream
add, clear, clone, contains, isEmpty, iterator, remove, size
spliterator
public 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 © 2019 Connect2id Ltd.. All rights reserved.