Package it.tidalwave.util
Interface RoleFactory<T,R>
- Type Parameters:
T
- the type of the owner
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory of roles.
- Author:
- Fabrizio Giudici
-
Method Summary
Modifier and TypeMethodDescriptioncreateRoleFor
(T owner) Returns one or more roles — if multiple ones have to be returned, they must be wrapped in aCollection
.Returns the role type.static <T> Collection
<Object> resolveFactories
(T owner, Iterable<Object> roleOrFactories) Returns a collection of roles resolving factories.
-
Method Details
-
createRoleFor
Returns one or more roles — if multiple ones have to be returned, they must be wrapped in aCollection
..- Parameters:
owner
- the owner- Returns:
- one or more roles — if multiple ones have to be returned, they must be wrapped in a
Collection
-
getRoleType
Returns the role type..- Returns:
- the role type
- Since:
- 4.0-ALPHA-2
-
resolveFactories
@Nonnull static <T> Collection<Object> resolveFactories(@Nonnull T owner, @Nonnull Iterable<Object> roleOrFactories) Returns a collection of roles resolving factories.; that is, any factory in the collection is invoked so it can eventually create another role.- Parameters:
owner
- the role ownerroleOrFactories
- a collection of roles orRoleFactory
instances- Returns:
- a collection of roles resolving factories
- Since:
- 4.0-ALPHA-2
-