- this.notificationPublishService = notificationPublishService;
- this.notificationId = notificationId;
- this.timeToTake = secondsToTake * SECOND_AS_NANO;
- this.delay = SECOND_AS_NANO / maxPerSecond;
+ this.notificationPublishService = requireNonNull(notificationPublishService);
+ this.notificationId = requireNonNull(notificationId);
+ checkArgument(secondsToTake > 0);
+ timeToTake = secondsToTake * SECOND_AS_NANO;
+ checkArgument(maxPerSecond > 0);
+ delay = SECOND_AS_NANO / maxPerSecond;