Class AbstractActionPermission<This extends AbstractActionPermission<This>>

All Implemented Interfaces:
Serializable, Guard, PermissionVerifier
Direct Known Subclasses:
AbstractActionSetPermission

public abstract class AbstractActionPermission<This extends AbstractActionPermission<This>> extends AbstractNamedPermission<This>
An abstract base class for named permissions that have actions, with useful API and implementation methods. All the constraints described in AbstractNamedPermission apply.
Author:
David M. Lloyd
See Also:
  • Constructor Details

    • AbstractActionPermission

      protected AbstractActionPermission(String name)
      Construct a new instance.
      Parameters:
      name - the permission name
  • Method Details

    • implies

      public final boolean implies(This permission)
      Determine whether this permission implies another permission. Returns true if both impliesActions(AbstractActionPermission) and AbstractNamedPermission.impliesName(AbstractNamedPermission) return true.
      Overrides:
      implies in class AbstractNamedPermission<This extends AbstractActionPermission<This>>
      Parameters:
      permission - the other permission
      Returns:
      true if this permission implies the other; false otherwise
    • equals

      public final boolean equals(This permission)
      Determine whether this permission is equal to another permission. Returns true if both actionsEquals(AbstractActionPermission) and AbstractNamedPermission.nameEquals(AbstractNamedPermission) return true.
      Overrides:
      equals in class AbstractNamedPermission<This extends AbstractActionPermission<This>>
      Parameters:
      permission - the other permission
      Returns:
      true if this permission implies the other; false otherwise
    • hashCode

      public final int hashCode()
      Description copied from class: AbstractPermission
      Get the hash code of this permission. The result must be consistent with the defined AbstractPermission.equals(AbstractPermission) result.
      Overrides:
      hashCode in class AbstractNamedPermission<This extends AbstractActionPermission<This>>
      Returns:
      the hash code of this permission
    • actionsEquals

      public abstract boolean actionsEquals(String actions)
      Determine whether the actions of this permission are equal to the given actions.
      Parameters:
      actions - the actions string (must not be null)
      Returns:
      true if the actions are equal, false otherwise
    • actionsEquals

      public final boolean actionsEquals(Permission permission)
      Determine whether the actions of this permission are equal to the actions of given permission. If the permission is not of the same type as this permission, false is returned.
      Parameters:
      permission - the permission whose actions are to be compared
      Returns:
      true if the actions are equal, false otherwise
    • actionsEquals

      public abstract boolean actionsEquals(This permission)
      Determine whether the actions of this permission are equal to the actions of given permission.
      Parameters:
      permission - the permission whose actions are to be compared
      Returns:
      true if the actions are equal, false otherwise
    • actionsHashCode

      protected abstract int actionsHashCode()
      Get the actions hash code.
      Returns:
      the actions hash code
    • impliesActions

      public abstract boolean impliesActions(String actions)
      Determine whether this permission's actions value implies the given actions value.
      Parameters:
      actions - the actions to test (must not be null)
      Returns:
      true if this permission implies the other; false otherwise
    • impliesActions

      public final boolean impliesActions(Permission permission)
      Determine whether this permission's actions value implies the actions of the given permission. If the permission is not of the same type as this permission, false is returned.
      Parameters:
      permission - the permission whose actions are to be compared
      Returns:
      true if this permission implies the other; false otherwise
    • impliesActions

      public abstract boolean impliesActions(This permission)
      Determine whether this permission's actions value implies the actions of the given permission.
      Parameters:
      permission - the permission whose actions are to be compared
      Returns:
      true if this permission implies the other; false otherwise
    • withActions

      public abstract This withActions(String actionsString)
      Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given string. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      actionsString - the actions string (must not be null)
      Returns:
      the permission (not null)
    • withActionsFrom

      public This withActionsFrom(This permission)
      Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given permission. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      permission - the other permission (must not be null)
      Returns:
      the permission (not null)
    • withoutActions

      public abstract This withoutActions(String actionsString)
      Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given string. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      actionsString - the actions string (must not be null)
      Returns:
      the permission (not null)
    • withoutActionsFrom

      public This withoutActionsFrom(This permission)
      Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given permission. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      permission - the other permission (must not be null)
      Returns:
      the permission (not null)
    • withNewActions

      public abstract This withNewActions(String actionsString)
      Get a permission which is identical to this one, but with new actions as given by actionsString. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      actionsString - the actions string (must not be null)
      Returns:
      the permission (not null)
    • withNewActionsFrom

      public This withNewActionsFrom(This permission)
      Get a permission which is identical to this one, but with new actions as given by actionsString. The returned permission may or may not be a new instance, and may be equal to this instance.
      Parameters:
      permission - the other permission (must not be null)
      Returns:
      the permission (not null)