public class EMessageKey extends java.lang.Object implements java.lang.Comparable<EMessageKey>, java.io.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(java.lang.Class<? extends EMessage> mc,
java.lang.String subject)
Creates a new message key for the given message class and
subject.
|
Modifier and Type | Method and Description |
---|---|
java.lang.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(java.lang.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 |
isAssignableFrom(EMessageKey key)
Returns
true if key 's message class is
assignable from this key's message class and the
subjects are equal; otherwise returns false . |
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()
|
java.lang.String |
keyString()
Returns the key in string format:
"message class name/subject".
|
java.lang.Class<? extends EMessage> |
messageClass()
Returns the message class.
|
EMessage.MessageType |
messageType()
Returns the key message type.
|
static EMessageKey |
parseKey(java.lang.String s)
Returns a message key parsed from the given input.
|
java.lang.String |
subject()
Returns the subject.
|
java.lang.String |
toString()
Returns a textual representation of this message key.
|
public static final char KEY_IFS
public EMessageKey(java.lang.Class<? extends EMessage> mc, java.lang.String subject)
mc
- message class.subject
- message subjectjava.lang.NullPointerException
- if either mc
or subject
is null
.java.lang.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 java.lang.Comparable<EMessageKey>
key
- comparison object.public boolean equals(java.lang.Object obj)
true
if obj
is a
non-null EMessageKey
instance with equivalent
message class and subject; returns false
otherwise.equals
in class java.lang.Object
obj
- comparison object.true
if obj
is equivalent to
this
.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String className()
public java.lang.Class<? extends EMessage> messageClass()
public java.lang.String subject()
public java.lang.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 boolean isAssignableFrom(EMessageKey key)
true
if key
's message class is
assignable from this
key's message class and the
subjects are equal; otherwise returns false
.key
- message key compared to this
message
key.key
is assignable from this
message key.public static EMessageKey parseKey(java.lang.String s) throws java.lang.IllegalArgumentException, InvalidMessageException
null
or an empty string, then
null
is returned.s
- the message key in text form.java.lang.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 © 2001 - 2024. Charles W. Rapp. All rights reserved.