Package org.wildfly.security.permission
Class BooleanPermissionCollection
- java.lang.Object
-
- java.security.PermissionCollection
-
- org.wildfly.security.permission.AbstractPermissionCollection
-
- org.wildfly.security.permission.BooleanPermissionCollection
-
- All Implemented Interfaces:
Serializable
,Iterable<Permission>
,PermissionVerifier
public final class BooleanPermissionCollection extends AbstractPermissionCollection
A permission collection type which either does or does not hold its instance.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Constructor Description BooleanPermissionCollection(AbstractPermission<?> sourcePermission)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAdd(AbstractPermission<?> permission)
Perform the work of adding a permission.Enumeration<Permission>
elements()
Iterate over this permission collection.boolean
implies(Permission permission)
Determine if the permission is verified by this object.Iterator<Permission>
iterator()
Iterate over this permission collection.int
size()
Get the size of this permission collection.-
Methods inherited from class org.wildfly.security.permission.AbstractPermissionCollection
add
-
Methods inherited from class java.security.PermissionCollection
elementsAsStream, isReadOnly, setReadOnly, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
-
-
-
Constructor Detail
-
BooleanPermissionCollection
public BooleanPermissionCollection(AbstractPermission<?> sourcePermission)
Construct a new instance.- Parameters:
sourcePermission
- the source permission for this collection (must not benull
)
-
-
Method Detail
-
size
public int size()
Description copied from class:AbstractPermissionCollection
Get the size of this permission collection.- Specified by:
size
in classAbstractPermissionCollection
- Returns:
- the size of this permission collection
-
iterator
public Iterator<Permission> iterator()
Description copied from class:AbstractPermissionCollection
Iterate over this permission collection.- Specified by:
iterator
in interfaceIterable<Permission>
- Specified by:
iterator
in classAbstractPermissionCollection
- Returns:
- the iterator (not
null
)
-
elements
public Enumeration<Permission> elements()
Description copied from class:AbstractPermissionCollection
Iterate over this permission collection.- Specified by:
elements
in classAbstractPermissionCollection
- Returns:
- the iterator (not
null
)
-
doAdd
protected void doAdd(AbstractPermission<?> permission)
Description copied from class:AbstractPermissionCollection
Perform the work of adding a permission. The permission is guaranteed to be of the correct type and the collection is guaranteed to have been writable at the time theAbstractPermissionCollection.add(Permission)
method was called.- Specified by:
doAdd
in classAbstractPermissionCollection
- Parameters:
permission
- the non-null
permission
-
implies
public boolean implies(Permission permission)
Description copied from interface:PermissionVerifier
Determine if the permission is verified by this object.- Specified by:
implies
in interfacePermissionVerifier
- Specified by:
implies
in classPermissionCollection
- Parameters:
permission
- the permission to verify (must not benull
)- Returns:
true
if the permission is implied by this verifier,false
otherwise
-
-