Package net.sf.eBusx.monitor
Class MonitorId
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EField
-
- net.sf.eBusx.monitor.MonitorId
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MonitorId>
public final class MonitorId extends EField implements java.lang.Comparable<MonitorId>, java.io.Serializable
A passive, immutable class for storing a monitored object's type name, instance name and its assigned unique, 4-byte integer identifier. ThetoString()
return value serves as the subject for an eBus object instancePersistentStatusMessage
andTransientStatusMessage
notifications.- Author:
- Charles Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MonitorId.Builder
Builder class used to create anMonitorId
field.
-
Field Summary
Fields Modifier and Type Field Description int
id
The object's assigned integer identifier.java.lang.String
instanceName
The monitored object's name.java.lang.String
typeName
The monitored object's type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MonitorId.Builder
builder()
Returns a new instance of aMonitorId
message field builder.int
compareTo(MonitorId mId)
boolean
equals(java.lang.Object o)
Returnstrue
ifo
is a non-null MonitorId
instance with the same integer identifier; otherwise, returnsfalse
.int
hashCode()
Returns the unique, 4-byte, signed monitor identifier.java.lang.String
toString()
Returns "<type name>.<instance name>".
-
-
-
Method Detail
-
compareTo
public int compareTo(MonitorId mId)
- Specified by:
compareTo
in interfacejava.lang.Comparable<MonitorId>
-
equals
public boolean equals(java.lang.Object o)
Returnstrue
ifo
is a non-null MonitorId
instance with the same integer identifier; otherwise, returnsfalse
.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- comparison object.- Returns:
true
ifo
equalsthis MonitorId
instance andfalse
otherwise.
-
hashCode
public int hashCode()
Returns the unique, 4-byte, signed monitor identifier.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the unique, 4-byte, signed monitor identifier.
-
toString
public java.lang.String toString()
Returns "<type name>.<instance name>". This return values is the subject for a registered eBus object instancePersistentStatusMessage
andTransientStatusMessage
notifications.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the textual representation of this monitor identifier.
-
builder
public static MonitorId.Builder builder()
Returns a new instance of aMonitorId
message field builder.- Returns:
- message field builder instance.
-
-