com.nimbusds.oauth2.sdk
Class Scope

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<Scope.Value>
              extended by com.nimbusds.oauth2.sdk.Scope
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Scope.Value>, Collection<Scope.Value>, Set<Scope.Value>

@NotThreadSafe
public class Scope
extends HashSet<Scope.Value>

Authorisation scope. This class is not thread-safe.

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:

Author:
Vladimir Dzhuvinov
See Also:
Serialized Form

Nested Class Summary
static class Scope.Value
          Authorisation scope value.
 
Constructor Summary
Scope()
          Creates a new empty authorisation scope.
 
Method Summary
static Scope parse(String s)
          Parses a scope from the specified string representation.
 String toString()
          Returns the string representation of this scope.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

Scope

public Scope()
Creates a new empty authorisation scope.

Method Detail

toString

public String toString()
Returns the string representation of this scope. The scope values may be serialised in any order.

Overrides:
toString in class AbstractCollection<Scope.Value>
Returns:
The string representation.

parse

public static Scope parse(String s)
Parses a scope from the specified string representation.

Parameters:
s - The scope string, null if not specified.
Returns:
The scope, null if not specified.


Copyright © 2013 NimbusDS. All Rights Reserved.