Record Class StaticScopeResolver
java.lang.Object
java.lang.Record
com.mastercard.developer.oauth2.core.scope.StaticScopeResolver
- All Implemented Interfaces:
ScopeResolver
A
ScopeResolver that always returns a fixed list of scopes regardless of the URL.-
Constructor Summary
ConstructorsConstructorDescriptionStaticScopeResolver(Set<String> scopes) Creates a newStaticScopeResolverwith the given scopes. -
Method Summary
Modifier and TypeMethodDescriptionReturns all possible scopes that can be requested.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns a set of scopes to request for an HTTP request to the given URL with the given method.scopes()Returns the value of thescopesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StaticScopeResolver
Creates a newStaticScopeResolverwith the given scopes. If the provided set is null, an empty set will be used instead.
-
-
Method Details
-
resolve
Description copied from interface:ScopeResolverReturns a set of scopes to request for an HTTP request to the given URL with the given method.- Specified by:
resolvein interfaceScopeResolver
-
allScopes
Description copied from interface:ScopeResolverReturns all possible scopes that can be requested.- Specified by:
allScopesin interfaceScopeResolver
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
scopes
Returns the value of thescopesrecord component.- Returns:
- the value of the
scopesrecord component
-