模块  java.base
软件包  java.security.acl

Interface Group

  • All Superinterfaces:
    Principal

    @Deprecated(since="9",
                forRemoval=true)
    public interface Group
    extends Principal
    Deprecated, for removal: This API element is subject to removal in a future version.
    This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.Policy and related classes since 1.2.
    此接口用于表示一组主体。 (委托人代表个人用户或公司等实体)。

    请注意,Group扩展了Principal。 因此,可以将Principal或Group作为参数传递给包含Principal参数的方法。 例如,您可以通过调用对象的addMember方法将Principal或Group添加到Group对象,并将其传递给Principal或Group。

    从以下版本开始:
    1.1
    • 方法详细信息

      • addMember

        boolean addMember​(Principal user)
        Deprecated, for removal: This API element is subject to removal in a future version.
        将指定的成员添加到组中。
        参数
        user - 要添加到此组的主体。
        结果
        如果成功添加成员,则返回true;如果主体已成为成员,则返回false。
      • removeMember

        boolean removeMember​(Principal user)
        Deprecated, for removal: This API element is subject to removal in a future version.
        从组中删除指定的成员。
        参数
        user - 要从此组中删除的主体。
        结果
        如果委托人被移除则为true;如果委托人不是委员,则为false。
      • isMember

        boolean isMember​(Principal member)
        Deprecated, for removal: This API element is subject to removal in a future version.
        如果传递的主体是组的成员,则返回true。 此方法执行递归搜索,因此如果主体属于该组的成员,则返回true。
        参数
        member - 要检查其成员资格的委托人。
        结果
        如果委托人是该组的成员,则返回true,否则返回false。
      • members

        Enumeration<? extends Principal> members()
        Deprecated, for removal: This API element is subject to removal in a future version.
        返回组中成员的枚举。 返回的对象可以是Principal或Group的实例(它是Principal的子类)。
        结果
        小组成员的列举。