Record Class EvolutionResult
java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.snapshot.api.EvolutionResult
- Record Components:
eventsApplied- the number of events applied while sourcing the entity, never negativesourcingTime- the total time spent sourcing the entity, nevernull
Represents metrics collected while sourcing an event-sourced entity to its current state.
EvolutionResult captures information about the sourcing process,
including how many events were applied, how long the process took,
and whether a snapshot was requested during sourcing.
This information is provided to the Snapshotter once sourcing
has completed, allowing it to make an informed decision about creating
and persisting a snapshot.
- Since:
- 5.1.0
- Author:
- John Hendrikx
-
Constructor Summary
ConstructorsConstructorDescriptionEvolutionResult(long eventsApplied, Duration sourcingTime) Creates a newEvolutionResult. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theeventsAppliedrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thesourcingTimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvolutionResult
Creates a newEvolutionResult.- Throws:
NullPointerException- ifsourcingTimeisnullIllegalArgumentException- ifeventsAppliedis negative
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
eventsApplied
public long eventsApplied()Returns the value of theeventsAppliedrecord component.- Returns:
- the value of the
eventsAppliedrecord component
-
sourcingTime
Returns the value of thesourcingTimerecord component.- Returns:
- the value of the
sourcingTimerecord component
-