Class DefaultAlarm.Builder

  • Enclosing class:
    DefaultAlarm

    public static class DefaultAlarm.Builder
    extends Object
    Builder for the DefaultAlarm object.
    • Constructor Detail

      • Builder

        public Builder​(Alarm alarm)
        Constructs a Builder to create a Default Alarm based on another alarm.
        Parameters:
        alarm - the other alarm
      • Builder

        public Builder​(AlarmId id,
                       DeviceId deviceId,
                       String description,
                       Alarm.SeverityLevel severity,
                       long timeRaised)
        Constructs a Builder to create a Default Alarm.
        Parameters:
        id - the AlarmId
        deviceId - the device ID
        description - the Alarm description
        severity - the severity
        timeRaised - when the alarm was raised
    • Method Detail

      • withTimeUpdated

        public DefaultAlarm.Builder withTimeUpdated​(long timeUpdated)
        Sets the new alarm time updated.
        Parameters:
        timeUpdated - the time
        Returns:
        self for chaining
      • withTimeCleared

        public DefaultAlarm.Builder withTimeCleared​(Long timeCleared)
        Sets the new alarm time cleared.
        Parameters:
        timeCleared - the time
        Returns:
        self for chaining
      • clear

        public DefaultAlarm.Builder clear()
        Clears the alarm that is being created.
        Returns:
        self for chaining
      • withServiceAffecting

        public DefaultAlarm.Builder withServiceAffecting​(boolean isServiceAffecting)
        Sets the new alarm service affecting flag.
        Parameters:
        isServiceAffecting - the service affecting flag
        Returns:
        self for chaining
      • withAcknowledged

        public DefaultAlarm.Builder withAcknowledged​(boolean isAcknowledged)
        Sets the new alarm acknowledged flag.
        Parameters:
        isAcknowledged - the acknowledged flag
        Returns:
        self for chaining
      • withManuallyClearable

        public DefaultAlarm.Builder withManuallyClearable​(boolean isManuallyClearable)
        Sets the new alarm the manually clearable flag.
        Parameters:
        isManuallyClearable - the manually clearable flag
        Returns:
        self for chaining
      • withAssignedUser

        public DefaultAlarm.Builder withAssignedUser​(String assignedUser)
        Sets the new alarm assigned user.
        Parameters:
        assignedUser - the user
        Returns:
        self for chaining
      • build

        public DefaultAlarm build()
        Builds the alarm.
        Returns:
        self for chaining