Package it.tidalwave.ui.core.role
Class PresentationModelAggregate
java.lang.Object
it.tidalwave.ui.core.role.PresentationModelAggregate
- All Implemented Interfaces:
it.tidalwave.role.Aggregate<PresentationModel>
public class PresentationModelAggregate
extends Object
implements it.tidalwave.role.Aggregate<PresentationModel>
A specialisation of
Aggregate
<PresentationModel>
which offers a convenience method for aggregating
its contained objects.- Since:
- 2.0-ALPHA-1
- Author:
- Fabrizio Giudici
-
Field Summary
Fields inherited from interface it.tidalwave.role.Aggregate
_Aggregate_
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetNames()
static PresentationModelAggregate
Creates a new, empty instance.withPmOf
(String name, Collection<Object> roles) Adds anotherPresentationModel
with the given roles, associated to the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.tidalwave.role.Aggregate
with
-
Constructor Details
-
PresentationModelAggregate
public PresentationModelAggregate()
-
-
Method Details
-
newInstance
Creates a new, empty instance.- Returns:
- the new instance
-
withPmOf
@Nonnull public PresentationModelAggregate withPmOf(@Nonnull String name, @Nonnull Collection<Object> roles) Adds anotherPresentationModel
with the given roles, associated to the given name. With a plainAggregate
<PresentationModel>
the code would be:Aggregate<PresentationModel> aggregate = Aggregate.newInstance() .with("name", PresentationModel.of("", r(role1, role2, role3));
The simplified code is:Aggregate<PresentationModel> aggregate = PresentationModelAggregate.newInstance() .withPmOf("name", r(role1, role2, role3));
- Parameters:
name
- the name of thePresentationModel
roles
- the roles- Returns:
- the new
PresentationModel
-
getByName
- Specified by:
getByName
in interfaceit.tidalwave.role.Aggregate<PresentationModel>
-
getNames
- Specified by:
getNames
in interfaceit.tidalwave.role.Aggregate<PresentationModel>
-