public class MessageId extends Object implements Comparable<MessageId>, Cloneable, Serializable
Container for a multi-part message id. MessageIds can have multiple parts which allows for the addition of child messages while maintaining the original order. A multi-part message id can be viewed as an array of integers where the size of the array is the number of parts. All messages which have a part n are considered children of a message with a part n-1. Initially all messages start with a single part. For example:
Initial messages:
1
2
3
Then, message 1 adds some children, message 2 adds children which add children (shown sorted):
1
1.1
1.2
2
2.1
2.2
2.2.1
2.2.2
3
Modifier and Type | Field and Description |
---|---|
protected int[] |
id |
protected int |
numChildren |
Constructor and Description |
---|
MessageId(int... id)
constructor, used to create a single- or multi-part message id.
|
MessageId(int[] parentParts,
int childId)
constructor, used to create a multi-part message id.
|
Modifier and Type | Method and Description |
---|---|
MessageId |
addChild() |
MessageId |
clone() |
int |
compareTo(MessageId o)
a comparison based on the id parts of the message id only.
|
MessageId |
createNextSibling() |
boolean |
equals(Object obj) |
int |
getNumberOfChildren() |
int |
getNumberOfParts() |
int |
getPart(int idx) |
int[] |
getParts() |
int |
hashCode() |
static MessageId |
invalidMessageId()
Used for auditing failed message creation
|
boolean |
isParentOf(MessageId child) |
static int[] |
parseMessageId(String value)
Parse
value as a message id. |
void |
setNumberOfChildren(int numChildren)
Sets the number of expected children.
|
String |
stringValue()
a non-overridable toString()
|
String |
toString() |
static String |
toString(int[] value)
Represent
value as a message id string. |
static MessageId |
valueOf(String value)
Converts the result of MessageId.toString() to a MessageId
|
public MessageId(int... id)
NOTE!! Use of this constructor will not create a multi-part message ids with the correct number of children set. To
reliably create children the addChild()
method should be used on the parent MessageId.
id
- list of parts, none of which can be 0.public MessageId(int[] parentParts, int childId)
parentParts
- the parts for the parentchildId
- the id for the childpublic static MessageId invalidMessageId()
public int getNumberOfChildren()
public void setNumberOfChildren(int numChildren)
numChildren
- public int getNumberOfParts()
public boolean isParentOf(MessageId child)
child
- child
.public int[] getParts()
public int getPart(int idx)
idx
- idx
of the MessageIdpublic MessageId createNextSibling()
public MessageId addChild()
public int compareTo(MessageId o)
compareTo
in interface Comparable<MessageId>
public final String stringValue()
public static MessageId valueOf(String value)
public static String toString(int[] value)
value
as a message id string.public static int[] parseMessageId(String value)
value
as a message id.Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.