Class AggregateSequenceNumberPosition

java.lang.Object
org.axonframework.eventsourcing.eventstore.AggregateSequenceNumberPosition
All Implemented Interfaces:
Position

public final class AggregateSequenceNumberPosition extends Object implements Position
An implementation of Position based on aggregate sequence numbers.
Since:
5.0.0
Author:
John Hendrikx
  • Method Details

    • toSequenceNumber

      public static long toSequenceNumber(@Nonnull Position position)
      Converts the given position to a sequence number, if possible.
      Parameters:
      position - A position, cannot be null.
      Returns:
      A sequence number.
      Throws:
      NullPointerException - When any argument is null.
      IllegalArgumentException - When the given position could not be converted.
    • min

      @Nonnull public Position min(@Nonnull Position other)
      Description copied from interface: Position
      Returns the smallest of the two positions. If one of the positions is Position.START, this function will always return this value. Implementors must ensure this operation is symmetric, and so should always return Position.START when called with it.
      Specified by:
      min in interface Position
      Parameters:
      other - Another position, cannot be null.
      Returns:
      The smallest of the two positions, never null.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object