Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
MaxDurationInSeconds.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.termination.auxiliary;
2 
6 public final class MaxDurationInSeconds {
7  private final long maxDurationInSeconds;
8 
9  public MaxDurationInSeconds(long maxDurationInSeconds) {
10  if (maxDurationInSeconds <= 0) {
11  throw new IllegalArgumentException(
12  String.format("Max duration in seconds must be > 0. Provided value is %s", maxDurationInSeconds));
13  }
14  this.maxDurationInSeconds = maxDurationInSeconds;
15  }
16 
17  public static MaxDurationInSeconds of(long maxDurationInSeconds) {
18  return new MaxDurationInSeconds(maxDurationInSeconds);
19  }
20 
21  public long value() {
22  return maxDurationInSeconds;
23  }
24 }