Class RegexRoles

  • All Implemented Interfaces:
    Iterable<String>, Roles

    class RegexRoles
    extends Object
    implements Roles
    A regex roles.

    Roles that are checked against pattern. Roles that contain the pattern are then replaced using the replacement. Pattern can capture groups that replacement can make use of. It is possible to replace all occurrences or only the first occurrence of the pattern in role.

    Author:
    Diana Vilkolakova
    • Field Detail

      • delegate

        private final Roles delegate
      • pattern

        private final Pattern pattern
      • replace

        private final String replace
      • keepNonMapped

        private final boolean keepNonMapped
      • replaceAll

        private final boolean replaceAll
    • Constructor Detail

      • RegexRoles

        RegexRoles​(Roles delegate,
                   Pattern pattern,
                   String replace,
                   boolean keepNonMapped,
                   boolean replaceAll)
    • Method Detail

      • contains

        public boolean contains​(String roleName)
        Description copied from interface: Roles
        Determine if this collection contains the given role name.
        Specified by:
        contains in interface Roles
        Parameters:
        roleName - the role name
        Returns:
        true if the role is contained in this collection, false otherwise