public interface Roles extends Iterable<String>
Modifier and Type | Field and Description |
---|---|
static Roles |
NONE
The empty roles collection.
|
Modifier and Type | Method and Description |
---|---|
default Roles |
addPrefix(String prefix)
Get a roles collection which adds a prefix to all role names.
|
default Roles |
addSuffix(String suffix)
Get a roles collection which adds a suffix to all role names.
|
default Roles |
and(Roles other)
Get the intersection of this collection and another.
|
boolean |
contains(String roleName)
Determine if this collection contains the given role name.
|
default boolean |
containsAll(Set<String> desiredRoles)
Determine if this collection contains all of the given role names.
|
default boolean |
containsAny(Set<String> desiredRoles)
Determine if this collection contains any of the given role names.
|
static Roles |
fromSet(Set<String> set)
Construct a new roles collection from a set.
|
default boolean |
isEmpty()
Determine whether this roles collection is empty.
|
default Roles |
minus(Roles other)
Get a roles collection which consists of the roles in this collection minus the roles in the other collection.
|
static Roles |
of(String role)
Construct a role set consisting of a single role.
|
default Roles |
or(Roles other)
Get the union of this collection and another.
|
default Spliterator<String> |
spliterator()
Create a
Spliterator over this roles collection. |
default Roles |
xor(Roles other)
Get the disjunction of this collection and another.
|
static final Roles NONE
boolean contains(String roleName)
roleName
- the role nametrue
if the role is contained in this collection, false
otherwisedefault boolean containsAny(Set<String> desiredRoles)
desiredRoles
- the roles to check.true
if this collection contains any of the desired roles, false
otherwise.default boolean containsAll(Set<String> desiredRoles)
desiredRoles
- the roles to check.true
if this collection contains all of the desired roles, false
otherwise.default boolean isEmpty()
true
if the collection is empty, false
otherwisedefault Spliterator<String> spliterator()
Spliterator
over this roles collection.spliterator
in interface Iterable<String>
null
)static Roles fromSet(Set<String> set)
set
- the set of role names (must not be null
)null
)static Roles of(String role)
role
- the role name (must not be null
)null
)default Roles and(Roles other)
other
- the other roles collection (must not be null
)null
)default Roles or(Roles other)
other
- the other roles collection (must not be null
)null
)default Roles xor(Roles other)
other
- the other roles collection (must not be null
)null
)default Roles minus(Roles other)
other
- the other collection (must not be null
)null
)default Roles addSuffix(String suffix)
suffix
- the suffix to add (must not be null
)null
)Copyright © 2020 JBoss by Red Hat. All rights reserved.