public interface RoleBuilder
Role
instances
than using a constructor method directly.Modifier and Type | Interface and Description |
---|---|
static class |
RoleBuilder.Implementation
A simple
RoleBuilder default implementation. |
Modifier and Type | Method and Description |
---|---|
default Role |
build()
Builds a
Role instance from the assembly data currently available to the builder instance and then
resets the builder internally. |
Role |
buildUnresetted()
Builds a
Role by creating a new instance of that type, using the assembly data currently available
to the builder instance. |
RoleBuilder |
grant(Permission permission) |
RoleBuilder |
grant(Role role) |
String |
name() |
RoleBuilder |
name(String name) |
static RoleBuilder |
New(RoleManager roleManager)
Creates a new
RoleBuilder instance connected to be passed RoleManager , using a
Role.Creator default implementation. |
static RoleBuilder |
New(RoleManager roleManager,
Role.Creator roleCreator)
Creates a new
RoleBuilder instance connected to be passed RoleManager , using the passed
Role.Creator instance. |
Collection<? extends Permission> |
permissions() |
RoleBuilder |
permissions(Collection<? extends Permission> permissions) |
RoleBuilder |
reset()
Resets this
RoleBuilder instance's internal state to default values (effectively "clearing" the state). |
Collection<? extends Role> |
roles() |
RoleBuilder |
roles(Collection<? extends Role> roles) |
String name()
Collection<? extends Role> roles()
Collection<? extends Permission> permissions()
RoleBuilder name(String name)
RoleBuilder grant(Role role)
RoleBuilder grant(Permission permission)
RoleBuilder roles(Collection<? extends Role> roles)
RoleBuilder permissions(Collection<? extends Permission> permissions)
RoleBuilder reset()
RoleBuilder
instance's internal state to default values (effectively "clearing" the state).Role buildUnresetted()
Role
by creating a new instance of that type, using the assembly data currently available
to the builder instance. The builder's internal data is NOT resetted after the instantiation is completed.
This is useful if another instance with the exactely or largely the same data and maybe just little changes
shall be created subsequently.default Role build()
Role
instance from the assembly data currently available to the builder instance and then
resets the builder internally.Role
instance built from the available data.buildUnresetted()
,
reset()
static RoleBuilder New(RoleManager roleManager)
RoleBuilder
instance connected to be passed RoleManager
, using a
Role.Creator
default implementation.roleManager
- the RoleManager
for which this builder shall build Role
instances.RoleBuilder
instancestatic RoleBuilder New(RoleManager roleManager, Role.Creator roleCreator)
RoleBuilder
instance connected to be passed RoleManager
, using the passed
Role.Creator
instance.roleManager
- the RoleManager
for which this builder shall build Role
instances.roleCreator
- the Role.Creator
instance to be used for creating new Role
instances.RoleBuilder
instance