public class RoleRepository extends NamedObjectRepository<Role>
| Modifier and Type | Method and Description |
|---|---|
Role |
createRole(String roleName)
Creates a role and adds it this repository
|
Role |
getOrCreate(String roleName)
Gets a role from this repository or creates a new one if there is no such role
|
static RoleRepository |
getSingletonInstance() |
public static RoleRepository getSingletonInstance()
public Role createRole(String roleName) throws IllegalArgumentException, DuplicateException
roleName - name of the role to be created. Must be unique in the repositoryDuplicateException - if a role with the same name was already createdIllegalArgumentException - if (roleName == null || roleName.isEmpty())public Role getOrCreate(String roleName) throws IllegalArgumentException
roleName - role to be obtained/createdIllegalArgumentException - if (roleName == null || roleName.isEmpty())Copyright © 2015 Agapsys Tecnologia Ltda-ME. All rights reserved.