Package com.opencqrs.esdb.client
Record Class Option.FromLatestEvent
java.lang.Object
java.lang.Record
com.opencqrs.esdb.client.Option.FromLatestEvent
- Record Components:
subject- the subject to read the latest event fromtype- theEvent.type()that the latest event must matchifEventIsMissing- specifies the fall-back fetch strategy, in case there is no such event
- All Implemented Interfaces:
Option
- Enclosing interface:
Option
public static record Option.FromLatestEvent(@NotBlank String subject, @NotBlank String type, @NotNull Option.FromLatestEvent.IfEventIsMissing ifEventIsMissing)
extends Record
implements Option
Specifies that the list of events is optimized by omitting any event prior to the latest event available
for the subject specified as part of
this.
This is typically used to read so-called snapshot events from the given subject location in favor of consuming a much longer event stream for the actual subject being fetched.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the fall-back fetch strategy.Nested classes/interfaces inherited from interface com.opencqrs.esdb.client.Option
Option.FromLatestEvent, Option.LowerBoundExclusive, Option.LowerBoundInclusive, Option.Order, Option.Recursive, Option.UpperBoundExclusive, Option.UpperBoundInclusive -
Constructor Summary
ConstructorsConstructorDescriptionFromLatestEvent(@NotBlank String subject, @NotBlank String type, @NotNull Option.FromLatestEvent.IfEventIsMissing ifEventIsMissing) Creates an instance of aFromLatestEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theifEventIsMissingrecord component.@NotBlank Stringsubject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.@NotBlank Stringtype()Returns the value of thetyperecord component.
-
Constructor Details
-
FromLatestEvent
public FromLatestEvent(@NotBlank @NotBlank String subject, @NotBlank @NotBlank String type, @NotNull @NotNull Option.FromLatestEvent.IfEventIsMissing ifEventIsMissing) Creates an instance of aFromLatestEventrecord class.- Parameters:
subject- the value for thesubjectrecord componenttype- the value for thetyperecord componentifEventIsMissing- the value for theifEventIsMissingrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
ifEventIsMissing
Returns the value of theifEventIsMissingrecord component.- Returns:
- the value of the
ifEventIsMissingrecord component
-