Class IncrementalSequenceGenerator

java.lang.Object
com.sportradar.livedata.sdk.common.classes.IncrementalSequenceGenerator
All Implemented Interfaces:
SequenceGenerator

public class IncrementalSequenceGenerator extends Object implements SequenceGenerator
A SequenceGenerator implementation where each value is obtained by incrementing the previous one.
Author:
uros.bregar
  • Constructor Details

    • IncrementalSequenceGenerator

      public IncrementalSequenceGenerator(long minValue, long maxValue)
      Initializes a new instance of the IncrementalSequenceGenerator class.
      Parameters:
      minValue - The min allowed value of the counter.
      maxValue - The max allowed value of the counter. When the value is reached the value restarts at minValue.
    • IncrementalSequenceGenerator

      public IncrementalSequenceGenerator(long minValue, long maxValue, boolean initialRandomSelected)
      Initializes a new instance of the IncrementalSequenceGenerator class.
      Parameters:
      minValue - The min allowed value of the counter.
      maxValue - The max allowed value of the counter. When the value is reached the value restarts at minValue.
      initialRandomSelected - If true, initial value will be randomly selected between minValue and maxValue
  • Method Details

    • getNext

      public long getNext()
      Generates and returns next sequence number.
      Specified by:
      getNext in interface SequenceGenerator
      Returns:
      next sequence number.