Record Class SourcingStrategy.Absolute
java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.eventstore.SourcingStrategy.Absolute
- Record Components:
position- the position, cannot benull
- All Implemented Interfaces:
SourcingStrategy
- Enclosing interface:
SourcingStrategy
public static record SourcingStrategy.Absolute(Position position)
extends Record
implements SourcingStrategy
Absolute start position in the event stream.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.eventsourcing.eventstore.SourcingStrategy
SourcingStrategy.Absolute, SourcingStrategy.Snapshot -
Constructor Summary
Constructors -
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.merge(SourcingStrategy other) Merges this sourcing strategy with another sourcing strategy to produce a single effective strategy for event sourcing.position()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Absolute
Constructs a new instance.- Throws:
NullPointerException- if any argument isnull
-
-
Method Details
-
merge
Description copied from interface:SourcingStrategyMerges this sourcing strategy with another sourcing strategy to produce a single effective strategy for event sourcing.The merge operation is deterministic and defined as follows:
- Merging two
SourcingStrategy.Absolutestrategies results in anAbsolutewhose position is the minimum of both positions - Merging an
SourcingStrategy.Absolutewith aSourcingStrategy.Snapshotresults in theSnapshot - Merging two
SourcingStrategy.Snapshotinstances is not supported and results in anUnsupportedOperationException
- Specified by:
mergein interfaceSourcingStrategy- Parameters:
other- the other sourcing strategy to merge with this one, cannot benull- Returns:
- the merged sourcing strategy
- Merging two
-
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). -
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-