Package com.pingidentity.sdk.oauth20
Class Scope
java.lang.Object
com.pingidentity.sdk.oauth20.Scope
- All Implemented Interfaces:
Serializable
The OAuth scope.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts a space delimited string of scopes to a set.static StringConverts a set of scopes to a space delimited string of scopes.booleanDetermines if two scope objects contain the same list of scopes.expanded()Expands all group mappings by iterating the scopes.static ScopeObtain a Scope representing the specified space delimited scope string.Get the set of scopes.Get the list of scopes.booleanhasAllScopes(Scope scope) A Scope object contains a set of scopes.inthashCode()Returns the object's hashcodebooleanDetermines if the current set of scopes contains the specified scope.booleanisEqualOrLesserThan(Scope scope) Determines if the scope object contains the same scopes, or less, than the one passed in.scopesNotIn(Scope scope) Returns the difference between the current scope and the scope passed in.toString()Get the string of scopes.
-
Constructor Details
-
Scope
Create a new scope.- Parameters:
scopeStr- a space delimited scope string.
-
Scope
Create a new scope.- Parameters:
scopeSet- a set of scope strings.
-
Scope
Create a new scope.- Parameters:
scopeArray- scope strings.
-
-
Method Details
-
getScope
Obtain a Scope representing the specified space delimited scope string.If the specified space delimited scope string represents a configured Default Scope, Common or Exclusive Scope, Common or Exclusive Scope Group, or a Common or Exclusive Dynamic Scope object, a cached scope object will be returned. Otherwise, a new Scope will be created and returned.
- Parameters:
scopeStr- a space delimited scope string.- Returns:
- a Scope representing the specified space delimited scope string.
-
getScopeStr
Get the list of scopes.- Returns:
- a space delimited string of scopes.
-
toString
Get the string of scopes. -
getScopeSet
Get the set of scopes.- Returns:
- a set of scopes.
-
hasScope
Determines if the current set of scopes contains the specified scope.- Parameters:
individualScopeValue- the scope to search for.- Returns:
- true if this scope contains the specified scope, false otherwise.
-
equals
Determines if two scope objects contain the same list of scopes. -
hashCode
public int hashCode()Returns the object's hashcode -
isEqualOrLesserThan
Determines if the scope object contains the same scopes, or less, than the one passed in.- Parameters:
scope- the scope to compare.- Returns:
- true if the scope object contains the same, or fewer, scopes than the one passed in.
-
hasAllScopes
A Scope object contains a set of scopes. This method determines if the set of scopes within the current Scope object contains all scopes passed in with the 'other' Scope object.- Parameters:
scope- : the set of scopes within the Scope object to search for.- Returns:
- true if the set of scopes within the Scope object contains all scopes passed in, false otherwise.
-
scopesNotIn
Returns the difference between the current scope and the scope passed in. e.g. current scope: { a, b, c }. passed in scope: { b, c }. Returns: a- Parameters:
scope- the scope to compare differences.- Returns:
- Returns the difference between the current scope and the scope passed in.
-
expanded
Expands all group mappings by iterating the scopes. If a group contains that scope, all scopes in that group are added to the list of scopes to be returned.e.g. a scope contains scopes = { a, b, c } and group a = { d, e } and group b = { a, f } then this will return a new scope containing scopes { a, b, c, d, e, f }
- Returns:
- a new scope containing just scopes with all group mappings expanded.
-
decode
Converts a space delimited string of scopes to a set.- Parameters:
scope- space delimited string of scopes.- Returns:
- set of scopes.
-
encode
Converts a set of scopes to a space delimited string of scopes.- Parameters:
scopes- a set of scopes.- Returns:
- a space delimited string of scopes.
-