@Portable public class DefaultPermissionCollection extends Object implements PermissionCollection
Constructor and Description |
---|
DefaultPermissionCollection() |
Modifier and Type | Method and Description |
---|---|
PermissionCollection |
add(Permission... permissions)
Adds a permission object to the current collection of permission objects.
|
DefaultPermissionCollection |
clone()
Creates an exact copy of this instance.
|
Collection<Permission> |
collection()
Returns all the Permission objects in the collection.
|
protected boolean |
equalsName(String s1,
String s2) |
Permission |
get(String name)
Gets a permission object matching the specified name.
|
boolean |
implies(Permission permission)
Checks to see if the specified permission is implied by
the collection of Permission objects held in this PermissionCollection.
|
boolean |
impliesName(Permission permission)
It returns true provided this collection already contains a permission which implies by name
(See
Permission.impliesName(Permission) ) the permission passed as a parameter. |
PermissionCollection |
invert(Permission target) |
PermissionCollection |
merge(PermissionCollection other,
int priority)
Get all the permissions from this collection and the given one and puts them
into a brand new collection instance.
|
PermissionCollection |
remove(Permission... permissions)
Removes a permission object from the current collection of permission objects.
|
String |
toString() |
public Collection<Permission> collection()
PermissionCollection
collection
in interface PermissionCollection
public PermissionCollection add(Permission... permissions)
PermissionCollection
add
in interface PermissionCollection
permissions
- the Permission objects to add.public PermissionCollection remove(Permission... permissions)
PermissionCollection
remove
in interface PermissionCollection
permissions
- the Permission objects to remove.public Permission get(String name)
PermissionCollection
get
in interface PermissionCollection
name
- The fully qualified name of the permission.public boolean implies(Permission permission)
PermissionCollection
implies
in interface PermissionCollection
permission
- the Permission object to compare.public boolean impliesName(Permission permission)
PermissionCollection
Permission.impliesName(Permission)
) the permission passed as a parameter.impliesName
in interface PermissionCollection
permission
- the permission to checkpublic PermissionCollection merge(PermissionCollection other, int priority)
PermissionCollection
priority
parameter is taken into account in case
the same permission is present in both collections.merge
in interface PermissionCollection
other
- the collection to merge.priority
- integer indicating what to do if the same permission is found in both collections:
public DefaultPermissionCollection clone()
PermissionCollection
clone
in interface PermissionCollection
clone
in class Object
public PermissionCollection invert(Permission target)
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.