Package org.wildfly.security.authz
Interface Roles
A collection of roles.
- Author:
- David M. Lloyd
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault RolesGet a roles collection which adds a prefix to all role names.default RolesGet a roles collection which adds a suffix to all role names.default RolesGet the intersection of this collection and another.booleanDetermine if this collection contains the given role name.default booleancontainsAll(Set<String> desiredRoles) Determine if this collection contains all of the given role names.default booleancontainsAny(Set<String> desiredRoles) Determine if this collection contains any of the given role names.static RolesConstruct a new roles collection from a set.default booleanisEmpty()Determine whether this roles collection is empty.default RolesGet a roles collection which consists of the roles in this collection minus the roles in the other collection.static RolesConstruct a role set consisting of a single role.default RolesGet the union of this collection and another.default Spliterator<String>Create aSpliteratorover this roles collection.Returns a set (immutable) containing roles from a roles collection.default RolesGet the disjunction of this collection and another.
-
Field Details
-
NONE
The empty roles collection.
-
-
Method Details
-
contains
Determine if this collection contains the given role name.- Parameters:
roleName- the role name- Returns:
trueif the role is contained in this collection,falseotherwise
-
containsAny
Determine if this collection contains any of the given role names.- Parameters:
desiredRoles- the roles to check.- Returns:
trueif this collection contains any of the desired roles,falseotherwise.
-
containsAll
Determine if this collection contains all of the given role names.- Parameters:
desiredRoles- the roles to check.- Returns:
trueif this collection contains all of the desired roles,falseotherwise.
-
isEmpty
default boolean isEmpty()Determine whether this roles collection is empty.- Returns:
trueif the collection is empty,falseotherwise
-
spliterator
Create aSpliteratorover this roles collection.- Specified by:
spliteratorin interfaceIterable<String>- Returns:
- the spliterator (not
null)
-
fromSet
Construct a new roles collection from a set.- Parameters:
set- the set of role names (must not benull)- Returns:
- the roles collection (not
null)
-
toSet
Returns a set (immutable) containing roles from a roles collection.- Parameters:
roles- collection (notnull)- Returns:
- the set of role names (must not be
null)
-
of
Construct a role set consisting of a single role.- Parameters:
role- the role name (must not benull)- Returns:
- the role set (not
null)
-
and
Get the intersection of this collection and another.- Parameters:
other- the other roles collection (must not benull)- Returns:
- the intersection (not
null)
-
or
Get the union of this collection and another.- Parameters:
other- the other roles collection (must not benull)- Returns:
- the union (not
null)
-
xor
Get the disjunction of this collection and another.- Parameters:
other- the other roles collection (must not benull)- Returns:
- the disjunction (not
null)
-
minus
Get a roles collection which consists of the roles in this collection minus the roles in the other collection.- Parameters:
other- the other collection (must not benull)- Returns:
- the difference (not
null)
-
addSuffix
Get a roles collection which adds a suffix to all role names.- Parameters:
suffix- the suffix to add (must not benull)- Returns:
- the new roles collection (not
null)
-
addPrefix
Get a roles collection which adds a prefix to all role names.- Parameters:
prefix- the prefix to add (must not benull)- Returns:
- the new roles collection (not
null)
-