Package net.shibboleth.idp.saml.metadata

# Class ScopesContainer

java.lang.Object
net.shibboleth.idp.saml.metadata.ScopesContainer

public class ScopesContainer extends Object
A container for all the `Scope` elements (attached to either a `EntityDescriptor`, `IDPSSODescriptor` or `AttributeAuthorityDescriptor`).

## Field Summary

Fields
Modifier and Type
Field
Description
`private List<Predicate<String>>`
`regexpScopes`
The Regexp scopes.
`private Set<String>`
`simpleScopes`
The (non Regexp) scopes.

## Constructor Summary

Constructors
Constructor
Description
`ScopesContainer()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`matchesScope(String scope)`
Does the provided string match the scopes for this XMLObject?
`void`
`setRegexpScopes(Set<String> scopes)`
Sets the regexp scopes.
`void`
`setSimpleScopes(Set<String> scopes)`
Sets the non-regexp Scopes.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### simpleScopes

@Nonnull private Set<String> simpleScopes
The (non Regexp) scopes.

### regexpScopes

@Nonnull private List<Predicate<String>> regexpScopes
The Regexp scopes.

## Constructor Details

### ScopesContainer

public ScopesContainer()

## Method Details

### setSimpleScopes

public void setSimpleScopes(@Nullable Set<String> scopes)
Sets the non-regexp Scopes.
We force the input to be a set so as to enforce no duplicates and any performance hit as a result.

Parameters:
  `scopes` - what to set.

### setRegexpScopes

public void setRegexpScopes(@Nullable Set<String> scopes)
Sets the regexp scopes.
We force the input to be a set so as to enforce no duplicates and any performance hit as a result.

Parameters:
  `scopes` - what to set.

### matchesScope

public boolean matchesScope(@Nonnull @NotEmpty String scope)
Does the provided string match the scopes for this XMLObject?

We test first against the non regexp scopes for the sake of performance.

Parameters:
  `scope` - what to test.
Returns:
  whether it matches any of the scopes.