Package io.github.ai4ci.abm
Class ImmutableTestResult.Builder
java.lang.Object
io.github.ai4ci.abm.ImmutableTestResult.Builder
- Enclosing class:
- ImmutableTestResult
Builds instances of type
ImmutableTestResult
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableTestResult
.from
(TestResult instance) Fill a builder with attribute values from the providedTestResult
instance.setTestParams
(TestParameters testParams) Initializes the value for thetestParams
attribute.setTime
(long time) Initializes the value for thetime
attribute.setViralLoadTruth
(double viralLoadTruth) Initializes the value for theviralLoadTruth
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedTestResult
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setViralLoadTruth
@CanIgnoreReturnValue public final ImmutableTestResult.Builder setViralLoadTruth(double viralLoadTruth) Initializes the value for theviralLoadTruth
attribute.- Parameters:
viralLoadTruth
- The value for viralLoadTruth- Returns:
this
builder for use in a chained invocation
-
setTime
Initializes the value for thetime
attribute.- Parameters:
time
- The value for time- Returns:
this
builder for use in a chained invocation
-
setTestParams
@CanIgnoreReturnValue public final ImmutableTestResult.Builder setTestParams(TestParameters testParams) Initializes the value for thetestParams
attribute.- Parameters:
testParams
- The value for testParams- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableTestResult
.- Returns:
- An immutable instance of TestResult
- Throws:
IllegalStateException
- if any required attributes are missing
-