can DomainEvent setters be protected vs package-only?

Currently the methods setAggregateIdentifier() and setSequenceNumber()
in DomainEvent are package access. But it seems like events I
implement, depending on how they're constructed from the event store,
might want to assign the event data in two steps (first the data from
my domain, second the data needed for event maintenance).

Would it be possible to make these protected?

Hi Chris,

in the 1.2 version, there are additional constructors in the DomainEvent that allow subclasses to explicitly set the aggregate identifier and sequence number. Did you see those constructors? Will they help you in your use case?



I saw those (I'm using 2.0-SNAPSHOT from svn), but my use case is that
the domain data are assigned with a serialization framework (Jackson,
in this case) and the metadata (aggregate ID, sequence number) are
assigned separately.

I skirted the issue by just stuffing those metadata in the serialized
event rather than (or in addition to) in the event store. So it's okay
for now, if a little duplicative.