Package com.pnfsoftware.jeb.core.units
Class UnitNotification
java.lang.Object
com.pnfsoftware.jeb.core.units.UnitNotification
- All Implemented Interfaces:
IUnitNotification
Standard implementation of a notification.
-
Constructor Summary
ConstructorsConstructorDescriptionGeneric copy constructor.UnitNotification
(NotificationType type, String description) Create a notification.UnitNotification
(NotificationType type, String description, String address) Create a notification.UnitNotification
(NotificationType type, String description, String address, String key) Create a notification. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the optional address of this notification, if relevant.Get a custom description of the notification.getKey()
Retrieve the notification key (or name).long
Retrieve the creation timestamp of this notification.getType()
Get the notification type.toString()
-
Constructor Details
-
UnitNotification
Create a notification.- Parameters:
type
- mandatory typedescription
- optional description stringaddress
- optional address, useful forinteractive units
key
- unique key; if null, a random key will be generated and assigned to the notification
-
UnitNotification
Create a notification. A random key will be generated and assigned to the notification.- Parameters:
type
- mandatory typedescription
- optional description stringaddress
- optional address, useful forinteractive units
-
UnitNotification
Create a notification. A random key will be generated and assigned to the notification.- Parameters:
type
- mandatory typedescription
- optional description string
-
UnitNotification
Generic copy constructor.- Parameters:
src
-
-
-
Method Details
-
getType
Description copied from interface:IUnitNotification
Get the notification type.- Specified by:
getType
in interfaceIUnitNotification
- Returns:
- the non-null type
-
getDescription
Description copied from interface:IUnitNotification
Get a custom description of the notification. This comes as a complement of the type, if necessary.- Specified by:
getDescription
in interfaceIUnitNotification
- Returns:
- an optional description string
-
getAddress
Description copied from interface:IUnitNotification
Retrieve the optional address of this notification, if relevant. If the unit does support addressing (ie, the unit implementsIAddressableUnit
), that field may be used by clients for easy navigation to the location of interest.- Specified by:
getAddress
in interfaceIUnitNotification
- Returns:
- the optional address
-
getKey
Description copied from interface:IUnitNotification
Retrieve the notification key (or name). For a given unit, only one notification with a given key may exist; adding a notification will erase a previously existing one.- Specified by:
getKey
in interfaceIUnitNotification
- Returns:
-
getTimestampMs
public long getTimestampMs()Description copied from interface:IUnitNotification
Retrieve the creation timestamp of this notification.- Specified by:
getTimestampMs
in interfaceIUnitNotification
- Returns:
-
toString
-