public class EMessageKey extends Object implements Comparable<EMessageKey>, Serializable
| Modifier and Type | Field and Description |
|---|---|
static char |
KEY_IFS
Use 47 to separate the message class from message
subject.
|
| Constructor and Description |
|---|
EMessageKey(Class<? extends EMessage> mc,
String subject)
Creates a new message key for the given message class and
subject.
|
| Modifier and Type | Method and Description |
|---|---|
String |
className()
Returns the message class name.
|
int |
compareTo(EMessageKey key)
Returns an integer value that is <, equal to or >
zero if
this EMessageKey is <, equal to or
> key. |
boolean |
equals(Object obj)
Returns
true if obj is a
non-null EMessageKey instance with equivalent
message class and subject; returns false
otherwise. |
int |
hashCode()
Returns a hash code based on the message identifier and
subject.
|
boolean |
isLocalOnly()
Returns
true if the message class is local-only
and false if the message class may be transmitted. |
boolean |
isNotification()
|
boolean |
isReply()
|
boolean |
isRequest()
|
boolean |
isSystem()
|
String |
keyString()
Returns the key in string format:
"message class name/subject".
|
Class<? extends EMessage> |
messageClass()
Returns the message class.
|
EMessage.MessageType |
messageType()
Returns the key message type.
|
static EMessageKey |
parseKey(String s)
Returns a message key parsed from the given input.
|
String |
subject()
Returns the subject.
|
String |
toString()
Returns a textual representation of this message key.
|
public static final char KEY_IFS
public EMessageKey(Class<? extends EMessage> mc, String subject)
mc - message class.subject - message subjectNullPointerException - if either mc or subject is null.IllegalArgumentException - if subject is an empty string.public int compareTo(EMessageKey key)
this EMessageKey is <, equal to or
> key. Comparison is based on the message class
and then the message subject.compareTo in interface Comparable<EMessageKey>key - comparison object.public boolean equals(Object obj)
true if obj is a
non-null EMessageKey instance with equivalent
message class and subject; returns false
otherwise.public int hashCode()
public String toString()
public String className()
public Class<? extends EMessage> messageClass()
public String subject()
public String keyString()
public boolean isSystem()
true if the message key references a
system message.public boolean isNotification()
true if the message key references a
notification message.public boolean isRequest()
true if the message key references a
request message.public boolean isReply()
true if the message key references a
reply message.public boolean isLocalOnly()
true if the message class is local-only
and false if the message class may be transmitted.true if the message class is local-only.public EMessage.MessageType messageType()
public static EMessageKey parseKey(String s) throws IllegalArgumentException, InvalidMessageException
null or an empty string, then
null is returned.s - the message key in text form.IllegalArgumentException - if s is not properly formatted or contains an
unknown class name.InvalidMessageException - if s is properly formatted but contains an unknown
message class name.Copyright © 2019. All rights reserved.