Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
JTerminationCriteriaIterations.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.termination;
2 
3 import com.griddynamics.jagger.user.test.configurations.termination.auxiliary.IterationsNumber;
4 import com.griddynamics.jagger.user.test.configurations.termination.auxiliary.MaxDurationInSeconds;
5 
6 import java.util.Objects;
7 
14 
15  private final long iterationsNumber;
16  private final long maxDurationInSeconds;
17 
23  public JTerminationCriteriaIterations(IterationsNumber iterationsNumber, MaxDurationInSeconds maxDurationInSeconds) {
24  Objects.requireNonNull(iterationsNumber);
25  Objects.requireNonNull(maxDurationInSeconds);
26 
27  this.iterationsNumber = iterationsNumber.value();
28  this.maxDurationInSeconds = maxDurationInSeconds.value();
29  }
30 
36  public static JTerminationCriteriaIterations of(IterationsNumber iterationsNumber, MaxDurationInSeconds maxDurationInSeconds) {
37  return new JTerminationCriteriaIterations(iterationsNumber, maxDurationInSeconds);
38  }
39 
40  public long getIterationsNumber() {
41  return iterationsNumber;
42  }
43 
44  public long getMaxDurationInSeconds() {
45  return maxDurationInSeconds;
46  }
47 }