Class CorrelationId
- java.lang.Object
-
- com.thecoderscorner.menu.remote.protocol.CorrelationId
-
public class CorrelationId extends java.lang.ObjectA 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 Summary
Fields Modifier and Type Field Description static CorrelationIdEMPTY_CORRELATION
-
Constructor Summary
Constructors Constructor Description CorrelationId()Creates a new correlation ID that is relatively uniqueCorrelationId(java.lang.String correlationAsText)Creates a correlation id with the specified value, for existing correlation ids
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)longgetUnderlyingId()Gets the underlying ID.inthashCode()java.lang.StringtoString()Gets the value of the ID as a hex string
-
-
-
Field Detail
-
EMPTY_CORRELATION
public static final CorrelationId EMPTY_CORRELATION
-
-
Constructor Detail
-
CorrelationId
public CorrelationId(java.lang.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 Detail
-
toString
public java.lang.String toString()
Gets the value of the ID as a hex string- Overrides:
toStringin classjava.lang.Object- Returns:
- the correlation ID as a hex string.
-
getUnderlyingId
public long getUnderlyingId()
Gets the underlying ID.- Returns:
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-