Package io.helidon.security.abac.role
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a role to the list of roles for a user subject.addRoles
(Collection<String> rolesAllowed) Add a collection of roles for user subject to this builder.addServiceRoles
(Collection<String> rolesAllowed) Add a collection of roles for service subject to this builder.build()
Build the instance from this builder.Clears all roles currently set to this builder.Clears all service roles currently set to this builder.Load configuration data from configuration.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<RoleValidator.RoleConfig.Builder,
RoleValidator.RoleConfig> - Returns:
- instance of the built type
-
addRoles
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
Clears all roles currently set to this builder.- Returns:
- updated builder instance
-
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
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
Load configuration data from configuration.- Parameters:
config
- configuration located the key of this attribute config- Returns:
- updated builder instance
-