use of io.spine.server.stand.AggregateStateId in project core-java by SpineEventEngine.
the class RecordStorage method writeLifecycleFlags.
@Override
public void writeLifecycleFlags(I id, LifecycleFlags flags) {
final Optional<EntityRecord> optional = read(id);
if (optional.isPresent()) {
final EntityRecord record = optional.get();
final EntityRecord updated = record.toBuilder().setLifecycleFlags(flags).build();
write(id, updated);
} else {
// The AggregateStateId is a special case, which is not handled by the Identifier class.
final String idStr = id instanceof AggregateStateId ? id.toString() : idToString(id);
throw newIllegalStateException("Unable to load record for entity with ID: %s", idStr);
}
}
Aggregations