I
- the type for IDs of this class of aggregates@Experimental
public class AggregateRoot<I>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
AggregateRoot(BoundedContext context,
I id)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
I |
id()
Obtains the aggregate ID.
|
protected <S extends io.spine.base.EntityState,A extends AggregatePart<I,S,?,?>> |
partState(java.lang.Class<S> partStateClass)
Obtains a part state by its class.
|
protected AggregateRoot(BoundedContext context, I id)
context
- the bounded context to which the aggregate belongsid
- the ID of the aggregatepublic I id()
protected <S extends io.spine.base.EntityState,A extends AggregatePart<I,S,?,?>> S partState(java.lang.Class<S> partStateClass)
S
- the type of the part statepartStateClass
- the class of the state of the partjava.lang.IllegalStateException
- if a repository was not found, or the ID type of the part state does not match
the ID type of this AggregateRoot