Package org.wildfly.security.permission
Class AbstractPermission<This extends AbstractPermission<This>>
java.lang.Object
java.security.Permission
org.wildfly.security.permission.AbstractPermission<This>
- All Implemented Interfaces:
Serializable,Guard,PermissionVerifier
- Direct Known Subclasses:
AbstractBooleanPermission,AbstractNamedPermission,NoPermission
public abstract class AbstractPermission<This extends AbstractPermission<This>>
extends Permission
implements PermissionVerifier
An abstract base class for any permission.
- Author:
- David M. Lloyd
- See Also:
-
Field Summary
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPermission(String name) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDetermine whether this permission object is equal to another object.abstract booleanDetermine whether this permission object is equal to another object of this permission type.Get the actions string.abstract inthashCode()Get the hash code of this permission.final booleanimplies(Permission permission) Determine whether this permission implies another permission.abstract booleanDetermine whether this permission implies another permission.Get an empty permission collection which is capable of holding instances of this permission type.protected static voidrequireEmptyActions(String actions) Check to ensure that the given action string is empty ornull; otherwise, throw an exception.Methods inherited from class java.security.Permission
checkGuard, getName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
Constructor Details
-
AbstractPermission
Construct a new instance.- Parameters:
name- the permission name
-
-
Method Details
-
implies
Determine whether this permission implies another permission.- Specified by:
impliesin interfacePermissionVerifier- Specified by:
impliesin classPermission- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other;falseotherwise
-
implies
Determine whether this permission implies another permission.- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other;falseotherwise
-
equals
Determine whether this permission object is equal to another object.- Specified by:
equalsin classPermission- Parameters:
obj- the object to compare to- Returns:
trueif the object is a permission equal to this one;falseotherwise
-
equals
Determine whether this permission object is equal to another object of this permission type.- Parameters:
other- the permission to compare to- Returns:
trueif the object is a permission equal to this one;falseotherwise
-
hashCode
public abstract int hashCode()Get the hash code of this permission. The result must be consistent with the definedequals(AbstractPermission)result.- Specified by:
hashCodein classPermission- Returns:
- the hash code of this permission
-
getActions
Get the actions string. The default implementation always returns an empty string.- Specified by:
getActionsin classPermission- Returns:
- the actions string (not
null)
-
newPermissionCollection
Get an empty permission collection which is capable of holding instances of this permission type.The default implementation returns a
SimplePermissionCollection.- Overrides:
newPermissionCollectionin classPermission- Returns:
- the permission collection to use
-
requireEmptyActions
Check to ensure that the given action string is empty ornull; otherwise, throw an exception.- Parameters:
actions- the actions string- Throws:
IllegalArgumentException- if the actions string is not empty
-