1 package com.griddynamics.jagger.user.test.configurations.limits;
3 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.LowErrThresh;
4 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.LowWarnThresh;
5 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.UpWarnThresh;
6 import com.griddynamics.jagger.user.test.configurations.limits.auxiliary.UpErrThresh;
8 import java.util.Objects;
18 private final String metricId;
19 private final Double lowWarnThresh;
20 private final Double upperWarningThreshold;
21 private final Double lowerErrorThreshold;
22 private final Double upperErrorThreshold;
25 this.metricId = builder.metricId;
26 this.lowWarnThresh = builder.lowWarnThresh.value();
27 this.upperWarningThreshold = builder.upWarnThresh.value();
28 this.lowerErrorThreshold = builder.lowErrThresh.value();
29 this.upperErrorThreshold = builder.upErrThresh.value();
41 private boolean initialized;
53 throw new IllegalArgumentException(
"It is already initialized with values: " +
54 this.lowWarnThresh +
", " + this.lowErrThresh +
", " + this.upWarnThresh +
", " + this.upErrThresh);
56 Objects.requireNonNull(lowWarnThresh);
57 Objects.requireNonNull(upWarnThresh);
61 this.lowWarnThresh = lowWarnThresh;
62 this.upWarnThresh = upWarnThresh;
78 throw new IllegalArgumentException(
"It is already initialized with values: " +
79 this.lowWarnThresh +
", " + this.lowErrThresh +
", " + this.upWarnThresh +
", " + this.upErrThresh);
81 Objects.requireNonNull(lowErrThresh);
82 Objects.requireNonNull(upErrThresh);
84 this.lowErrThresh = lowErrThresh;
85 this.upErrThresh = upErrThresh;
103 throw new IllegalArgumentException(
"It is already initialized with values: " +
104 this.lowWarnThresh +
", " + this.lowErrThresh +
", " + this.upWarnThresh +
", " + this.upErrThresh);
106 Objects.requireNonNull(upWarnThresh);
107 Objects.requireNonNull(upErrThresh);
110 this.upErrThresh = upErrThresh;
112 this.upWarnThresh = upWarnThresh;
128 throw new IllegalArgumentException(
"It is already initialized with values: " +
129 this.lowWarnThresh +
", " + this.lowErrThresh +
", " + this.upWarnThresh +
", " + this.upErrThresh);
131 Objects.requireNonNull(lowWarnThresh);
132 Objects.requireNonNull(lowErrThresh);
134 this.lowErrThresh = lowErrThresh;
136 this.lowWarnThresh = lowWarnThresh;
155 throw new IllegalArgumentException(
"It is already initialized with values: " +
156 this.lowErrThresh +
", " + this.lowWarnThresh +
", " + this.upWarnThresh +
", " + this.upErrThresh);
158 Objects.requireNonNull(lowWarnThresh);
159 Objects.requireNonNull(lowErrThresh);
160 Objects.requireNonNull(upWarnThresh);
161 Objects.requireNonNull(upErrThresh);
163 this.lowErrThresh = lowErrThresh;
164 this.upErrThresh = upErrThresh;
165 this.lowWarnThresh = lowWarnThresh;
166 this.upWarnThresh = upWarnThresh;
188 return lowWarnThresh;
192 return upperWarningThreshold;
196 return lowerErrorThreshold;
200 return upperErrorThreshold;