Interface Position

All Known Implementing Classes:
AggregateSequenceNumberPosition, GlobalIndexPosition

public sealed interface Position permits GlobalIndexPosition, AggregateSequenceNumberPosition (not exhaustive)
Represents a position from which sourcing may start.
Since:
5.0.0
Author:
John Hendrikx
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Position
    Represents the smallest possible position.
  • Method Summary

    Modifier and Type
    Method
    Description
    min(Position other)
    Returns the smallest of the two positions.
  • Field Details

    • START

      static final Position START
      Represents the smallest possible position.
  • Method Details

    • min

      @Nonnull Position min(@Nonnull Position other)
      Returns the smallest of the two positions. If one of the positions is START, this function will always return this value. Implementors must ensure this operation is symmetric, and so should always return START when called with it.
      Parameters:
      other - Another position, cannot be null.
      Returns:
      The smallest of the two positions, never null.
      Throws:
      NullPointerException - When any argument is null.
      IllegalArgumentException - When the given position is incompatible with this position.