Class UnitNotification

java.lang.Object
com.pnfsoftware.jeb.core.units.UnitNotification
All Implemented Interfaces:
IUnitNotification

@Ser public class UnitNotification extends Object implements IUnitNotification
Standard implementation of a notification.
  • Constructor Details

    • UnitNotification

      public UnitNotification(NotificationType type, String description, String address, String key)
      Create a notification.
      Parameters:
      type - mandatory type
      description - optional description string
      address - optional address, useful for interactive units
      key - unique key; if null, a random key will be generated and assigned to the notification
    • UnitNotification

      public UnitNotification(NotificationType type, String description, String address)
      Create a notification. A random key will be generated and assigned to the notification.
      Parameters:
      type - mandatory type
      description - optional description string
      address - optional address, useful for interactive units
    • UnitNotification

      public UnitNotification(NotificationType type, String description)
      Create a notification. A random key will be generated and assigned to the notification.
      Parameters:
      type - mandatory type
      description - optional description string
    • UnitNotification

      public UnitNotification(IUnitNotification src)
      Generic copy constructor.
      Parameters:
      src -
  • Method Details

    • getType

      public NotificationType getType()
      Description copied from interface: IUnitNotification
      Get the notification type.
      Specified by:
      getType in interface IUnitNotification
      Returns:
      the non-null type
    • getDescription

      public String 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 interface IUnitNotification
      Returns:
      an optional description string
    • getAddress

      public 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 implements IAddressableUnit), that field may be used by clients for easy navigation to the location of interest.
      Specified by:
      getAddress in interface IUnitNotification
      Returns:
      the optional address
    • getKey

      public String 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 interface IUnitNotification
      Returns:
    • getTimestampMs

      public long getTimestampMs()
      Description copied from interface: IUnitNotification
      Retrieve the creation timestamp of this notification.
      Specified by:
      getTimestampMs in interface IUnitNotification
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object