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>
,Supplier<RoleValidator.RoleConfig>
- Enclosing class:
- RoleValidator.RoleConfig
public static class RoleValidator.RoleConfig.Builder extends Object implements Builder<RoleValidator.RoleConfig>
A fluent API builder forRoleValidator.RoleConfig
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoleValidator.RoleConfig.Builder
addRole(String role)
Add a role to the list of roles for a user subject.RoleValidator.RoleConfig.Builder
addRoles(Collection<String> rolesAllowed)
Add a collection of roles for user subject to this builder.RoleValidator.RoleConfig.Builder
addServiceRoles(Collection<String> rolesAllowed)
Add a collection of roles for service subject to this builder.RoleValidator.RoleConfig
build()
Build the instance from this builder.RoleValidator.RoleConfig.Builder
clearRoles()
Clears all roles currently set to this builder.RoleValidator.RoleConfig.Builder
clearServiceRoles()
Clears all service roles currently set to this builder.RoleValidator.RoleConfig.Builder
config(Config config)
Load configuration data from configuration.
-
-
-
Method Detail
-
build
public RoleValidator.RoleConfig build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<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
public RoleValidator.RoleConfig.Builder addRole(String role)
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
-
-