Class GlobalIndexPosition

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

public final class GlobalIndexPosition extends Object implements Position
An immutable implementation of Position which represents positions with an index in the global event stream.
Since:
5.0.0
Author:
John Hendrikx
  • Method Details

    • toIndex

      public static long toIndex(@Nonnull Position position)
      Converts the given position to a global index, if possible.
      Parameters:
      position - A position, cannot be null.
      Returns:
      A global index.
      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