Package org.onosproject.alarm
Class DefaultAlarm.Builder
- java.lang.Object
-
- org.onosproject.alarm.DefaultAlarm.Builder
-
- Enclosing class:
- DefaultAlarm
public static class DefaultAlarm.Builder extends java.lang.ObjectBuilder 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, java.lang.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 DefaultAlarmbuild()Builds the alarm.DefaultAlarm.Builderclear()Clears the alarm that is being created.DefaultAlarm.BuilderforSource(AlarmEntityId source)Sets the new alarm source.DefaultAlarm.BuilderwithAcknowledged(boolean isAcknowledged)Sets the new alarm acknowledged flag.DefaultAlarm.BuilderwithAssignedUser(java.lang.String assignedUser)Sets the new alarm assigned user.DefaultAlarm.BuilderwithManuallyClearable(boolean isManuallyClearable)Sets the new alarm the manually clearable flag.DefaultAlarm.BuilderwithServiceAffecting(boolean isServiceAffecting)Sets the new alarm service affecting flag.DefaultAlarm.BuilderwithTimeCleared(java.lang.Long timeCleared)Sets the new alarm time cleared.DefaultAlarm.BuilderwithTimeUpdated(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, java.lang.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(java.lang.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(java.lang.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
-
-