/** * Initializes a {@link GenericEventMessage} with given message as delegate and given {@code timestamp}. The * given message will be used supply the payload, metadata and identifier of the resulting event message. * * @param delegate the message that will be used used as delegate * @param timestamp the timestamp of the resulting event message */ protected GenericEventMessage(Message<T> delegate, Instant timestamp) { this(delegate, CachingSupplier.of(timestamp)); }
/** * Constructor to reconstruct an EventMessage using existing data. The timestamp of the event is supplied lazily to * prevent unnecessary deserialization of the timestamp. * * @param delegate The message containing payload, identifier and metadata * @param timestampSupplier Supplier for the timestamp of the Message creation */ public GenericEventMessage(Message<T> delegate, Supplier<Instant> timestampSupplier) { super(delegate); this.timestampSupplier = CachingSupplier.of(timestampSupplier); }
metaData = new LazyDeserializingObject<>(eventData.getMetaData(), serializer); eventIdentifier = eventData.getEventIdentifier(); timestamp = CachingSupplier.of(eventData::getTimestamp); if (eventData instanceof DomainEventData<?>) { DomainEventData<?> domainEventData = (DomainEventData<?>) eventData;
/** * Constructor to reconstruct an EventMessage using existing data. The timestamp of the event is supplied lazily to * prevent unnecessary deserialization of the timestamp. * * @param delegate The message containing payload, identifier and metadata * @param timestampSupplier Supplier for the timestamp of the Message creation */ public GenericEventMessage(Message<T> delegate, Supplier<Instant> timestampSupplier) { super(delegate); this.timestampSupplier = CachingSupplier.of(timestampSupplier); }
/** * Initializes a {@link GenericEventMessage} with given message as delegate and given {@code timestamp}. The * given message will be used supply the payload, metadata and identifier of the resulting event message. * * @param delegate the message that will be used used as delegate * @param timestamp the timestamp of the resulting event message */ protected GenericEventMessage(Message<T> delegate, Instant timestamp) { this(delegate, CachingSupplier.of(timestamp)); }
/** * Initializes a {@link GenericEventMessage} with given message as delegate and given {@code timestamp}. The * given message will be used supply the payload, metadata and identifier of the resulting event message. * * @param delegate the message that will be used used as delegate * @param timestamp the timestamp of the resulting event message */ protected GenericEventMessage(Message<T> delegate, Instant timestamp) { this(delegate, CachingSupplier.of(timestamp)); }
/** * Constructor to reconstruct an EventMessage using existing data. The timestamp of the event is supplied lazily to * prevent unnecessary deserialization of the timestamp. * * @param delegate The message containing payload, identifier and metadata * @param timestampSupplier Supplier for the timestamp of the Message creation */ public GenericEventMessage(Message<T> delegate, Supplier<Instant> timestampSupplier) { super(delegate); this.timestampSupplier = CachingSupplier.of(timestampSupplier); }
metaData = new LazyDeserializingObject<>(eventData.getMetaData(), serializer); eventIdentifier = eventData.getEventIdentifier(); timestamp = CachingSupplier.of(eventData::getTimestamp); if (eventData instanceof DomainEventData<?>) { DomainEventData<?> domainEventData = (DomainEventData<?>) eventData;
metaData = new LazyDeserializingObject<>(eventData.getMetaData(), serializer); eventIdentifier = eventData.getEventIdentifier(); timestamp = CachingSupplier.of(eventData::getTimestamp); if (eventData instanceof DomainEventData<?>) { DomainEventData<?> domainEventData = (DomainEventData<?>) eventData;