Package org.wildfly.security.authz
Interface RoleMapper
- 
- All Known Implementing Classes:
- MappedRoleMapper,- RegexRoleMapper
 - Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
 
 @FunctionalInterface public interface RoleMapper A role mapper is responsible for mapping roles based on their raw form.Roles are basically represented as Stringvalues, where these values are their names. Role mapping allows to transform roles from their raw form (eg.: just like they were loaded from a identity store such as a database or LDAP server) in a more consistent form.- Author:
- Pedro Igor
 
- 
- 
Field SummaryFields Modifier and Type Field Description static RoleMapperIDENTITY_ROLE_MAPPERA default implementation that does nothing but return the given roles.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static RoleMapperaggregate(RoleMapper... mappers)Create an aggregate role mapper.static RoleMapperaggregate(RoleMapper mapper1, RoleMapper mapper2)Create an aggregate role mapper.default RoleMapperand(RoleMapper other)Create a role mapper which is the intersection (logical "and") of the results of this and the given role mapper.static RoleMapperconstant(Roles roles)Create a role mapper that always returns the same set of roles regardless of the input.RolesmapRoles(Roles rolesToMap)Returns a set of strings representing the roles mapped from the given roles in their raw form.default RoleMapperminus(RoleMapper other)Create a role mapper which contains all the roles mapped by this mapper, minus the roles mapped by the given role mapper.default RoleMapperor(RoleMapper other)Create a role mapper which is the union (logical "or") of the results of this and the given role mapper.default RoleMapperxor(RoleMapper other)Create a role mapper which is the symmetric difference (or disjunction, or logical "xor") of the results of this and the given role mapper.
 
- 
- 
- 
Field Detail- 
IDENTITY_ROLE_MAPPERstatic final RoleMapper IDENTITY_ROLE_MAPPER A default implementation that does nothing but return the given roles.
 
- 
 - 
Method Detail- 
mapRolesRoles mapRoles(Roles rolesToMap) Returns a set of strings representing the roles mapped from the given roles in their raw form.- Parameters:
- rolesToMap- the roles in their raw form to apply mapping
- Returns:
- the mapped role set
 
 - 
anddefault RoleMapper and(RoleMapper other) Create a role mapper which is the intersection (logical "and") of the results of this and the given role mapper.- Parameters:
- other- the other role mapper
- Returns:
- the intersection role mapper
 
 - 
ordefault RoleMapper or(RoleMapper other) Create a role mapper which is the union (logical "or") of the results of this and the given role mapper.- Parameters:
- other- the other role mapper
- Returns:
- the union role mapper
 
 - 
xordefault RoleMapper xor(RoleMapper other) Create a role mapper which is the symmetric difference (or disjunction, or logical "xor") of the results of this and the given role mapper.- Parameters:
- other- the other role mapper
- Returns:
- the difference role mapper
 
 - 
minusdefault RoleMapper minus(RoleMapper other) Create a role mapper which contains all the roles mapped by this mapper, minus the roles mapped by the given role mapper.- Parameters:
- other- the other role mapper
- Returns:
- the difference role mapper
 
 - 
aggregatestatic RoleMapper aggregate(RoleMapper mapper1, RoleMapper mapper2) Create an aggregate role mapper. Each role mapper is applied in order.- Parameters:
- mapper1- the first role mapper to apply (must not be- null)
- mapper2- the second role mapper to apply (must not be- null)
- Returns:
- the aggregate role mapper (not null)
 
 - 
aggregatestatic RoleMapper aggregate(RoleMapper... mappers) Create an aggregate role mapper. Each role mapper is applied in order.- Parameters:
- mappers- the role mappers to apply (most not be- nullor contain- nullelements)
- Returns:
- the aggregate role mapper (not null)
 
 - 
constantstatic RoleMapper constant(Roles roles) Create a role mapper that always returns the same set of roles regardless of the input.- Parameters:
- roles- the set of roles to always be returned (must not be- null)
- Returns:
- the constant role mapper (not null)
 
 
- 
 
-