Class OrderInterceptor.Counter

  • Enclosing class:
    OrderInterceptor

    protected static class OrderInterceptor.Counter
    extends java.lang.Object
    Counter for tracking message sequence numbers.
    • Constructor Summary

      Constructors 
      Constructor Description
      Counter()
      Constructs a Counter with initial value 0.
      Counter​(int startValue)
      Constructs a Counter with the given initial value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCounter()
      Returns the current counter value.
      int inc()
      Increments the counter and returns the new value.
      void setCounter​(int counter)
      Sets the counter value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Counter

        public Counter()
        Constructs a Counter with initial value 0.
      • Counter

        public Counter​(int startValue)
        Constructs a Counter with the given initial value.
        Parameters:
        startValue - The initial value
    • Method Detail

      • getCounter

        public int getCounter()
        Returns the current counter value.
        Returns:
        The counter value
      • setCounter

        public void setCounter​(int counter)
        Sets the counter value.
        Parameters:
        counter - The new counter value
      • inc

        public int inc()
        Increments the counter and returns the new value.
        Returns:
        The new counter value