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 enum
Specifies 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 aFromLatestEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theifEventIsMissing
record component.@NotBlank String
subject()
Returns the value of thesubject
record component.final String
toString()
Returns a string representation of this record class.@NotBlank String
type()
Returns the value of thetype
record component.
-
Constructor Details
-
FromLatestEvent
public FromLatestEvent(@NotBlank @NotBlank String subject, @NotBlank @NotBlank String type, @NotNull @NotNull Option.FromLatestEvent.IfEventIsMissing ifEventIsMissing) Creates an instance of aFromLatestEvent
record class.- Parameters:
subject
- the value for thesubject
record componenttype
- the value for thetype
record componentifEventIsMissing
- the value for theifEventIsMissing
record 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 thesubject
record component.- Returns:
- the value of the
subject
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
ifEventIsMissing
Returns the value of theifEventIsMissing
record component.- Returns:
- the value of the
ifEventIsMissing
record component
-