java.lang.Object
com.thecoderscorner.menu.remote.protocol.CorrelationId

public class CorrelationId extends Object
A correlation ID that allows events sent from the client or server to be linked via this ID. Calling the constructor with no parameters creates a new correlation. These are only unique for a time frame of hours to days. They should not be used for any purpose requiring persistence that could extend beyond that.
  • Field Details

    • EMPTY_CORRELATION

      public static final CorrelationId EMPTY_CORRELATION
  • Constructor Details

    • CorrelationId

      public CorrelationId(String correlationAsText)
      Creates a correlation id with the specified value, for existing correlation ids
      Parameters:
      correlationAsText - the id to be represented
    • CorrelationId

      public CorrelationId()
      Creates a new correlation ID that is relatively unique
  • Method Details

    • toString

      public String toString()
      Gets the value of the ID as a hex string
      Overrides:
      toString in class Object
      Returns:
      the correlation ID as a hex string.
    • getUnderlyingId

      public long getUnderlyingId()
      Gets the underlying ID.
      Returns:
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object