Class ContextPermission

    • Constructor Summary

      Constructors 
      Constructor Description
      ContextPermission​(java.lang.String name, java.lang.String actions)
      Constructs a permission with the specified name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Determine if this permission is equal to the given object.
      boolean equals​(ContextPermission permission)
      Determine if this permission is equal to the given permission.
      java.lang.String getActions()
      Get the actions string.
      int hashCode()
      Get the hash code of this permission.
      boolean implies​(java.security.Permission permission)
      Determine if the given permission is implied by this permission.
      boolean implies​(ContextPermission permission)
      Determine if the given permission is implied by this permission.
      java.security.PermissionCollection newPermissionCollection()
      Get a new permission collection instance which can hold this type of permissions.
      ContextPermission withActions​(java.lang.String actions)
      Create a copy of this permission with the additional given actions.
      ContextPermission withoutActions​(java.lang.String actions)
      Create a copy of this permission without any of the given actions.
      • Methods inherited from class java.security.Permission

        checkGuard, getName, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ContextPermission

        public ContextPermission​(java.lang.String name,
                                 java.lang.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​(java.security.Permission permission)
        Determine if the given permission is implied by this permission.
        Specified by:
        implies in class java.security.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​(java.lang.Object obj)
        Determine if this permission is equal to the given object.
        Specified by:
        equals in class java.security.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 java.security.Permission
        Returns:
        the hash code of this permission
      • getActions

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

        @NotNull
        public ContextPermission withActions​(java.lang.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​(java.lang.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 java.security.PermissionCollection newPermissionCollection()
        Get a new permission collection instance which can hold this type of permissions.
        Overrides:
        newPermissionCollection in class java.security.Permission
        Returns:
        a new permission collection instance (not null)