Package com.codingchili.core.protocol
Class RoleMap
java.lang.Object
com.codingchili.core.protocol.RoleMap
Add custom roles to the rolemap, must be done before initializing protocols.
By mapping the name of the role to an instance annotations are no longer
limited to the default roles in #
Role
.-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
ADMIN
- See Also:
- Constant Field Values
-
USER
- See Also:
- Constant Field Values
-
PUBLIC
- See Also:
- Constant Field Values
-
UNSET
- See Also:
- Constant Field Values
-
-
Constructor Details
-
RoleMap
public RoleMap()
-
-
Method Details
-
put
Adds a role mapping.- Parameters:
name
- the name of the role.role
- the role implementation.
-
get
retrieves a role by its name.- Parameters:
name
- the name of the role to retrieve.- Returns:
- a registered role that matches the given name, throws an exception if the role is not registered.
-
get
- Parameters:
names
- multiple names to retrieve the roles for.- Returns:
- a list of roles that matches the given list. Throws an exception if any of the roles in the given names is not registered.
-