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