AggregateType class

Use AggregateType to define aggregates

Optional AggregateType fields for parameterized types when not given are inferred by introspection or restricted to default Types. If Eventuous.inferTypes is true (default) parameterized types are inferred by introspection of annotations associated with AggregateType. If introspection fails or Eventuous.inferTypes is false, parameterized types are given by (default) naming convention where applicable, or restricted to a default Type otherwise.

Following rules apply when fields in AggregateType for parameterized types are not given:

@AggregateType()
class Foo extends _$Foo
@AggregateType(Foo) // => infers TId is FooId1
class FooId1 extends AggregateId;
@AggregateType()
class Foo extends _$Foo {}
@JsonSerializable() // => infers TData is JsonMap
@AggregateEventType(Foo) // => links FooCreated with Foo
class FooCreated extends _$FooCreated {}
@AggregateType()
class Foo extends _$Foo {}
@JsonSerializable() // => TEvent is JsonObject
@AggregateEventType(Foo) // => links FooCreated with Foo
class FooCreated extends _$FooCreated {}
@AggregateType()
class Foo extends _$Foo {}
@JsonSerializable() // => infers TValue is JsonObject
@AggregateValueType(Foo) // => infers TValue is FooValue1
class FooValue1 _$FooState {}
@AggregateType()
class Foo extends _$Foo {}
@AggregateStateType(Foo) // => infers TState is FooState1
class FooState1 _$FooState {}

Constructors

AggregateType({Type? id, Type? event, Type? value, Type? state})
const

Properties

event Type?
final
hashCode int
The hash code for this object.
no setterinherited
id Type?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state Type?
final
value Type?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson(String aggregate) JsonMap
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited