12: Add grace period support for persistent alarms
This commit is contained in:
@@ -11,6 +11,7 @@ public record PriceAlarmDefinition(
|
||||
PriceDirection direction,
|
||||
BigDecimal target,
|
||||
AlarmTrigger trigger,
|
||||
long triggerGracePeriodSeconds,
|
||||
AlarmSeverity severity,
|
||||
String note
|
||||
) {
|
||||
@@ -24,5 +25,11 @@ public record PriceAlarmDefinition(
|
||||
if (target.signum() < 0) {
|
||||
throw new IllegalArgumentException("Target price cannot be negative (was: " + target.signum() + ")!");
|
||||
}
|
||||
|
||||
if (triggerGracePeriodSeconds < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"Trigger grace period cannot be negative: " + triggerGracePeriodSeconds
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user