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 instancePersistentStatusMessageandTransientStatusMessagenotifications.- Author:
- Charles Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMonitorId.BuilderBuilder class used to create anMonitorIdfield.
-
Field Summary
Fields Modifier and Type Field Description intidThe object's assigned integer identifier.java.lang.StringinstanceNameThe monitored object's name.java.lang.StringtypeNameThe monitored object's type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MonitorId.Builderbuilder()Returns a new instance of aMonitorIdmessage field builder.intcompareTo(MonitorId mId)booleanequals(java.lang.Object o)Returnstrueifois a non-null MonitorIdinstance with the same integer identifier; otherwise, returnsfalse.inthashCode()Returns the unique, 4-byte, signed monitor identifier.java.lang.StringtoString()Returns "<type name>.<instance name>".
-
-
-
Method Detail
-
compareTo
public int compareTo(MonitorId mId)
- Specified by:
compareToin interfacejava.lang.Comparable<MonitorId>
-
equals
public boolean equals(java.lang.Object o)
Returnstrueifois a non-null MonitorIdinstance with the same integer identifier; otherwise, returnsfalse.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- comparison object.- Returns:
trueifoequalsthis MonitorIdinstance andfalseotherwise.
-
hashCode
public int hashCode()
Returns the unique, 4-byte, signed monitor identifier.- Overrides:
hashCodein 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 instancePersistentStatusMessageandTransientStatusMessagenotifications.- Overrides:
toStringin classjava.lang.Object- Returns:
- the textual representation of this monitor identifier.
-
builder
public static MonitorId.Builder builder()
Returns a new instance of aMonitorIdmessage field builder.- Returns:
- message field builder instance.
-
-