Interface Roles

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Roles NONE
      The empty roles collection.
    • Field Detail

      • NONE

        static final Roles NONE
        The empty roles collection.
    • Method Detail

      • contains

        boolean contains​(String roleName)
        Determine if this collection contains the given role name.
        Parameters:
        roleName - the role name
        Returns:
        true if the role is contained in this collection, false otherwise
      • containsAny

        default boolean containsAny​(Set<String> desiredRoles)
        Determine if this collection contains any of the given role names.
        Parameters:
        desiredRoles - the roles to check.
        Returns:
        true if this collection contains any of the desired roles, false otherwise.
      • containsAll

        default boolean containsAll​(Set<String> desiredRoles)
        Determine if this collection contains all of the given role names.
        Parameters:
        desiredRoles - the roles to check.
        Returns:
        true if this collection contains all of the desired roles, false otherwise.
      • isEmpty

        default boolean isEmpty()
        Determine whether this roles collection is empty.
        Returns:
        true if the collection is empty, false otherwise
      • fromSet

        static Roles fromSet​(Set<String> set)
        Construct a new roles collection from a set.
        Parameters:
        set - the set of role names (must not be null)
        Returns:
        the roles collection (not null)
      • toSet

        static Set<String> toSet​(Roles roles)
        Returns a set (immutable) containing roles from a roles collection.
        Parameters:
        roles - collection (not null)
        Returns:
        the set of role names (must not be null)
      • of

        static Roles of​(String role)
        Construct a role set consisting of a single role.
        Parameters:
        role - the role name (must not be null)
        Returns:
        the role set (not null)
      • and

        default Roles and​(Roles other)
        Get the intersection of this collection and another.
        Parameters:
        other - the other roles collection (must not be null)
        Returns:
        the intersection (not null)
      • or

        default Roles or​(Roles other)
        Get the union of this collection and another.
        Parameters:
        other - the other roles collection (must not be null)
        Returns:
        the union (not null)
      • xor

        default Roles xor​(Roles other)
        Get the disjunction of this collection and another.
        Parameters:
        other - the other roles collection (must not be null)
        Returns:
        the disjunction (not null)
      • minus

        default Roles minus​(Roles other)
        Get a roles collection which consists of the roles in this collection minus the roles in the other collection.
        Parameters:
        other - the other collection (must not be null)
        Returns:
        the difference (not null)
      • addSuffix

        default Roles addSuffix​(String suffix)
        Get a roles collection which adds a suffix to all role names.
        Parameters:
        suffix - the suffix to add (must not be null)
        Returns:
        the new roles collection (not null)
      • addPrefix

        default Roles addPrefix​(String prefix)
        Get a roles collection which adds a prefix to all role names.
        Parameters:
        prefix - the prefix to add (must not be null)
        Returns:
        the new roles collection (not null)