Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
JLimitVsRefValue.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.limits;
2 
3 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.JMetricName;
4 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.RefValue;
5 
6 import java.util.Objects;
7 
11 public class JLimitVsRefValue extends JLimit {
12 
13  private Double refValue;
14 
15 
17  super(builder);
18  this.refValue = builder.refValue.value();
19  }
20 
28  public static Builder builder(String metricName, RefValue refValue) {
29  return new Builder(metricName, refValue);
30  }
31 
39  public static Builder builder(JMetricName metricName, RefValue refValue) {
40  return new Builder(metricName.transformToString(), refValue);
41  }
42 
43 
44  public static class Builder extends JLimit.Builder {
45  private RefValue refValue;
46 
47  private Builder(String metricName, RefValue refValue) {
48  Objects.requireNonNull(metricName);
49  Objects.requireNonNull(refValue);
50 
51  this.metricName = metricName;
52  this.refValue = refValue;
53  }
54 
55  @Override
56  public JLimit build() {
57  return new JLimitVsRefValue(this);
58  }
59 
60  }
61 
62 
63  public Double getRefValue() {
64  return refValue;
65  }
66 }