Package org.wildfly.security.permission
Class NoPermission
- java.lang.Object
-
- java.security.Permission
-
- org.wildfly.security.permission.AbstractPermission<NoPermission>
-
- org.wildfly.security.permission.NoPermission
-
- All Implemented Interfaces:
Serializable
,Guard
,PermissionVerifier
public final class NoPermission extends AbstractPermission<NoPermission>
A permission which implies nothing, not even itself.- 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 NoPermission()
Construct a new instance.NoPermission(String ignored)
Construct a new instance.NoPermission(String ignored1, String ignored2)
Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(NoPermission other)
Always returnstrue
if the argument is notnull
.static NoPermission
getInstance()
Get the no-permission instance.int
hashCode()
Get the constant hash code.boolean
implies(NoPermission permission)
Always returnsfalse
.AbstractPermissionCollection
newPermissionCollection()
Get an empty permission collection which is capable of holding instances of this permission type.-
Methods inherited from class org.wildfly.security.permission.AbstractPermission
equals, getActions, implies, requireEmptyActions
-
Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
-
-
-
Constructor Detail
-
NoPermission
public NoPermission()
Construct a new instance.
-
NoPermission
public NoPermission(String ignored)
Construct a new instance. The name parameter is ignored.- Parameters:
ignored
- ignored
-
-
Method Detail
-
getInstance
public static NoPermission getInstance()
Get the no-permission instance.- Returns:
- the no-permission instance (not
null
)
-
implies
public boolean implies(NoPermission permission)
Always returnsfalse
.- Specified by:
implies
in classAbstractPermission<NoPermission>
- Parameters:
permission
- ignored- Returns:
false
-
equals
public boolean equals(NoPermission other)
Always returnstrue
if the argument is notnull
.- Specified by:
equals
in classAbstractPermission<NoPermission>
- Parameters:
other
- the permission to compare to- Returns:
true
ifother
is notnull
;false
otherwise
-
hashCode
public int hashCode()
Get the constant hash code.- Specified by:
hashCode
in classAbstractPermission<NoPermission>
- Returns:
- the constant hash code
-
newPermissionCollection
public AbstractPermissionCollection newPermissionCollection()
Description copied from class:AbstractPermission
Get an empty permission collection which is capable of holding instances of this permission type.The default implementation returns a
SimplePermissionCollection
.- Overrides:
newPermissionCollection
in classAbstractPermission<NoPermission>
- Returns:
- the permission collection to use
-
-