Class RoleValidator.RoleConfig.Builder

java.lang.Object
io.helidon.security.abac.role.RoleValidator.RoleConfig.Builder
All Implemented Interfaces:
Builder<RoleValidator.RoleConfig.Builder,RoleValidator.RoleConfig>, Supplier<RoleValidator.RoleConfig>
Enclosing class:
RoleValidator.RoleConfig

public static class RoleValidator.RoleConfig.Builder extends Object implements Builder<RoleValidator.RoleConfig.Builder,RoleValidator.RoleConfig>
A fluent API builder for RoleValidator.RoleConfig.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public RoleValidator.RoleConfig build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<RoleValidator.RoleConfig.Builder,RoleValidator.RoleConfig>
      Returns:
      instance of the built type
    • addRoles

      public RoleValidator.RoleConfig.Builder addRoles(Collection<String> rolesAllowed)
      Add a collection of roles for user subject to this builder.
      Parameters:
      rolesAllowed - collection of roles, iterator order will be preserved for checking the roles
      Returns:
      updated builder instance
    • clearRoles

      public RoleValidator.RoleConfig.Builder clearRoles()
      Clears all roles currently set to this builder.
      Returns:
      updated builder instance
    • clearServiceRoles

      public RoleValidator.RoleConfig.Builder clearServiceRoles()
      Clears all service roles currently set to this builder.
      Returns:
      updated builder instance
    • addRole

      Add a role to the list of roles for a user subject. Role will be added only once (e.g. this builder is using a linked hash set to store the roles).
      Parameters:
      role - a role, order of calls to this method will be preserved
      Returns:
      updated builder instance
    • addServiceRoles

      public RoleValidator.RoleConfig.Builder addServiceRoles(Collection<String> rolesAllowed)
      Add a collection of roles for service subject to this builder.
      Parameters:
      rolesAllowed - collection of roles, iterator order will be preserved for checking the roles
      Returns:
      updated builder instance
    • config

      public RoleValidator.RoleConfig.Builder config(Config config)
      Load configuration data from configuration.
      Parameters:
      config - configuration located the key of this attribute config
      Returns:
      updated builder instance