Class ContextPermission

    • Constructor Detail

      • ContextPermission

        public ContextPermission​(String name,
                                 String actions)
        Constructs a permission with the specified name.
        Parameters:
        name - name of the Permission object being created (must not be null)
        actions - the actions string (must not be null)
    • Method Detail

      • implies

        public boolean implies​(Permission permission)
        Determine if the given permission is implied by this permission.
        Specified by:
        implies in class Permission
        Parameters:
        permission - the other permission
        Returns:
        true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise
      • implies

        public boolean implies​(ContextPermission permission)
        Determine if the given permission is implied by this permission.
        Parameters:
        permission - the other permission
        Returns:
        true if the other permission is not null and is a context permission which is implied by this permission instance; false otherwise
      • equals

        public boolean equals​(Object obj)
        Determine if this permission is equal to the given object.
        Specified by:
        equals in class Permission
        Parameters:
        obj - the other object
        Returns:
        true if the object is a context permission that is exactly equal to this one; false otherwise
      • equals

        public boolean equals​(ContextPermission permission)
        Determine if this permission is equal to the given permission.
        Parameters:
        permission - the other permission
        Returns:
        true if the permission is a context permission that is exactly equal to this one; false otherwise
      • hashCode

        public int hashCode()
        Get the hash code of this permission.
        Specified by:
        hashCode in class Permission
        Returns:
        the hash code of this permission
      • getActions

        public String getActions()
        Get the actions string. This string will be returned in a canonical format.
        Specified by:
        getActions in class Permission
        Returns:
        the actions string
      • withActions

        @NotNull
        public ContextPermission withActions​(String actions)
        Create a copy of this permission with the additional given actions.
        Parameters:
        actions - the additional actions (must not be null)
        Returns:
        the new permission (not null)
      • withoutActions

        @NotNull
        public ContextPermission withoutActions​(String actions)
        Create a copy of this permission without any of the given actions.
        Parameters:
        actions - the actions to subtract (must not be null)
        Returns:
        the new permission (not null)
      • newPermissionCollection

        public PermissionCollection newPermissionCollection()
        Get a new permission collection instance which can hold this type of permissions.
        Overrides:
        newPermissionCollection in class Permission
        Returns:
        a new permission collection instance (not null)