implies

Checks if the specified permission's actions are "implied by" this object's actions.

This must be implemented by subclasses of Permission, as they are the only ones that can impose semantics on a Permission object.

The implies method is used by the AccessController to determine whether or not a requested permission is implied by another permission that is known to be valid in the current execution context.

Parameters:

permission - the permission to check against.

Returns:

true if the specified permission is implied by this object, false if not.

equals

public boolean equals(java.lang.Object obj)

Checks two Permission objects for equality.

Do not use the equals method for making access control decisions; use the implies method.

Specified by:

equals in class java.security.Permission

Parameters:

obj - the object we are testing for equality with this object.

Returns:

true if both Permission objects are equivalent.

hashCode

public int hashCode()

Returns the hash code value for this Permission object.

The required hashCode behavior for Permission Objects is the following:

Whenever it is invoked on the same Permission object more than once during an execution of a Java application, the hashCode method must consistently return the same integer. This integer need not remain consistent from one execution of an application to another execution of the same application.

If two Permission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result.

Specified by:

hashCode in class java.security.Permission

Returns:

a hash code value for this object.

getActions

public java.lang.String getActions()

Returns the actions as a String. This is abstract so subclasses can defer creating a String representation until one is needed. Subclasses should always return actions in what they consider to be their canonical form. For example, two FilePermission objects created via the following: