Interface Permissions



  • public interface Permissions
    A collection of all existing permission types and their states.
    • Method Detail

      • getAllowedBitmask

        int getAllowedBitmask​()
        Gets the integer containing all allowed permission types.
        Returns:
        The integer containing all allowed permission types.
      • getDeniedBitmask

        int getDeniedBitmask​()
        Gets the integer containing all denied permission types.
        Returns:
        The integer containing all denied permission types.
      • getState

        PermissionState getState​(PermissionType type)
        Gets the state of the given type.
        Parameters:
        type - The type.
        Returns:
        The state of the type.
      • isEmpty

        boolean isEmpty​()
        Checks if the all permission types are set to PermissionState.UNSET.
        Returns:
        Whether all permission types are set to UNSET or not.
      • fromBitmask

        static Permissions fromBitmask​(int bitmask)
        Creates a Permissions object from the given bitmask. Permissions that are not included are marked as PermissionState.UNSET.
        Parameters:
        bitmask - The bitmask of allowed permissions.
        Returns:
        A Permissions object created from the given bitmask.
      • fromBitmask

        static Permissions fromBitmask​(int allowedBitmask,
                                       int deniedBitmask)
        Creates a Permissions object from the given bitmasks.

        Permissions that are not included in any bitmap are marked as PermissionState.UNSET. If a permission is included in both the allowed and denied bitmap, it is marked as PermissionState.UNSET.

        Parameters:
        allowedBitmask - The bitmask of allowed permissions.
        deniedBitmask - The bitmask of denied permissions.
        Returns:
        A Permissions object created from the given bitmasks.