api/src/java/org/apache/fulcrum/security/model/dynamic/entity/impl/DynamicGroupImpl.java [39:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Set<? extends Role> roleSet = new RoleSet();

    /**
     * Get the roles that are part of this group
     * 
     * @return a set of roles
     */
    public RoleSet getRoles()
    {
        if (roleSet instanceof RoleSet)
        {
            return (RoleSet) roleSet;
        }
        else
        {
            roleSet = new RoleSet(roleSet);
            return (RoleSet) roleSet;
        }
    }

    /**
     * Set the roles that are part of this group
     * 
     * @param roleSet
     *            a set of roles
     */
    public void setRoles(RoleSet roleSet)
    {
        if (roleSet != null)
        {
            this.roleSet = roleSet;
        }
        else
        {
            this.roleSet = new RoleSet();
        }
    }

    /**
     * Add a role to this group
     * 
     * @param role
     *            the role to add
     */
    public void addRole(Role role)
    {
        getRoles().add(role);
    }

    /**
     * Remove a role from this group
     * 
     * @param role
     *            the role to remove
     */
    public void removeRole(Role role)
    {
        getRoles().remove(role);
    }

    /**
     * Set the roles that are part of this group as Set
     * 
     * @param roles
     *            a set of roles
     */
    public <T extends Role> void setRolesAsSet(Set<T> roles)
    {
        this.roleSet = roles;
    }

    /**
     * Get the roles that are part of this group as Set
     * 
     * @return a set of roles
     */
    @SuppressWarnings("unchecked")
    public <T extends Role> Set<T> getRolesAsSet()
    {
        return (Set<T>) roleSet;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbinePermissionImpl.java [39:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Set<? extends Role> roleSet = new RoleSet();

    /**
     * Get the roles that this permission belongs to
     * 
     * @return a set of roles
     */
    public RoleSet getRoles()
    {
        if (roleSet instanceof RoleSet)
        {
            return (RoleSet) roleSet;
        }
        else
        {
            roleSet = new RoleSet(roleSet);
            return (RoleSet) roleSet;
        }
    }

    /**
     * Set the roles that this permission belongs to
     * 
     * @param roleSet
     *            a set of roles
     */
    public void setRoles(RoleSet roleSet)
    {
        if (roleSet != null)
        {
            this.roleSet = roleSet;
        }
        else
        {
            this.roleSet = new RoleSet();
        }
    }

    /**
     * Add a role to this permission
     * 
     * @param role
     *            the role to add
     */
    public void addRole(Role role)
    {
        getRoles().add(role);
    }

    /**
     * Remove a role from this permission
     * 
     * @param role
     *            the role to remove
     */
    public void removeRole(Role role)
    {
        getRoles().remove(role);
    }

    /**
     * Set the roles that this permission belongs to as Set
     * 
     * @param roles
     *            a set of roles
     */
    public <T extends Role> void setRolesAsSet(Set<T> roles)
    {
        this.roleSet = roles;
    }

    /**
     * Get the roles that this permission belongs to as Set
     * 
     * @return a set of roles
     */
    @SuppressWarnings("unchecked")
    public <T extends Role> Set<T> getRolesAsSet()
    {
        return (Set<T>) roleSet;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



