Class CorrelationId
- java.lang.Object
-
- de.quantummaid.eventmaid.identification.CorrelationId
-
public final class CorrelationId extends Object
Unique identifier to match all messages, that are related.- See Also:
- EventMaid Documentation
-
-
Constructor Summary
Constructors Constructor Description CorrelationId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CorrelationIdcorrelationIdFor(MessageId messageId)Creates aCorrelationIdmatching the givenMessageId.static CorrelationIdfromString(String value)Creates a newCorrelationIdusing the string representation of anUUID.booleanmatches(MessageId messageId)Checks, if theCorrelationIdis related to the givenMessageId.static CorrelationIdnewUniqueCorrelationId()Creates a new, randomly generatedCorrelationId.StringstringValue()Returns the String value representing theCorrelationId.
-
-
-
Method Detail
-
fromString
public static CorrelationId fromString(String value)
Creates a newCorrelationIdusing the string representation of anUUID.- Parameters:
value- the string representation of theUUID- Returns:
- a new
CorrelationId
-
correlationIdFor
public static CorrelationId correlationIdFor(MessageId messageId)
Creates aCorrelationIdmatching the givenMessageId.- Parameters:
messageId- theMessageIdto match- Returns:
- a new
CorrelationId
-
newUniqueCorrelationId
public static CorrelationId newUniqueCorrelationId()
Creates a new, randomly generatedCorrelationId.- Returns:
- the new, randomly generated
CorrelationId
-
matches
public boolean matches(MessageId messageId)
Checks, if theCorrelationIdis related to the givenMessageId.- Parameters:
messageId- theMessageIdto check- Returns:
trueif the ids are related,falseotherwise
-
stringValue
public String stringValue()
Returns the String value representing theCorrelationId.- Returns:
- a representative string value
-
-