Package org.onosproject.alarm
Class DefaultAlarm.Builder
- java.lang.Object
-
- org.onosproject.alarm.DefaultAlarm.Builder
-
- Enclosing class:
- DefaultAlarm
public static class DefaultAlarm.Builder extends Object
Builder for the DefaultAlarm object.
-
-
Constructor Summary
Constructors Constructor Description Builder(Alarm alarm)
Constructs a Builder to create a Default Alarm based on another alarm.Builder(AlarmId id, DeviceId deviceId, String description, Alarm.SeverityLevel severity, long timeRaised)
Constructs a Builder to create a Default Alarm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultAlarm
build()
Builds the alarm.DefaultAlarm.Builder
clear()
Clears the alarm that is being created.DefaultAlarm.Builder
forSource(AlarmEntityId source)
Sets the new alarm source.DefaultAlarm.Builder
withAcknowledged(boolean isAcknowledged)
Sets the new alarm acknowledged flag.DefaultAlarm.Builder
withAssignedUser(String assignedUser)
Sets the new alarm assigned user.DefaultAlarm.Builder
withManuallyClearable(boolean isManuallyClearable)
Sets the new alarm the manually clearable flag.DefaultAlarm.Builder
withServiceAffecting(boolean isServiceAffecting)
Sets the new alarm service affecting flag.DefaultAlarm.Builder
withTimeCleared(Long timeCleared)
Sets the new alarm time cleared.DefaultAlarm.Builder
withTimeUpdated(long timeUpdated)
Sets the new alarm time updated.
-
-
-
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 AlarmIddeviceId
- the device IDdescription
- the Alarm descriptionseverity
- the severitytimeRaised
- when the alarm was raised
-
-
Method Detail
-
forSource
public DefaultAlarm.Builder forSource(AlarmEntityId source)
Sets the new alarm source.- Parameters:
source
- the source- Returns:
- self for chaining
-
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
-
-