Class CompositeACLPermission

  • All Implemented Interfaces:
    ACLPermission, BitMaskPermission, Permission

    public class CompositeACLPermission
    extends Object
    implements BitMaskPermission

    This class represents a composite permission - a permission that contains one or more basic permissions. The bitmask value of this permission is calculated by combining (logical or) the bitmask values of the basic permissions it contains. Thus, a composite permission's bitmask can have more than one bit on, and each bit corresponds to one of the basic permissions that are part of the composite permission.

    Author:
    Stefan Guilhen
    • Constructor Detail

      • CompositeACLPermission

        public CompositeACLPermission​(int mask)

        Builds an instance of CompositeACLPermission with the specified bitmask value.

        Parameters:
        mask - an int representing the bitmask value of the permission being created.
      • CompositeACLPermission

        public CompositeACLPermission​(BasicACLPermission... permissions)

        Builds an instance of CompositeACLPermission with the given basic permissions.

        Parameters:
        permissions - a comma-separated list of BasicACLPermissions.
    • Method Detail

      • getMaskValue

        public int getMaskValue()
        Description copied from interface: BitMaskPermission

        Obtains the bitmask value of the permission.

        Specified by:
        getMaskValue in interface BitMaskPermission
        Returns:
        an int representing the value of the bitmask.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toBinaryString

        public String toBinaryString()

        Returns the binary representation of this permission.

        Returns:
        a String containing this permission's binary representation.