Package io.github.ai4ci.abm
Class ImmutableTestResult
java.lang.Object
io.github.ai4ci.abm.ImmutableTestResult
- All Implemented Interfaces:
TestResult
,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableTestResult
extends Object
implements TestResult
Immutable implementation of
TestResult
.
Use the builder to create immutable instances:
ImmutableTestResult.builder()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableTestResult
.Nested classes/interfaces inherited from interface io.github.ai4ci.abm.TestResult
TestResult.Result, TestResult.Type
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTestResult.Builder
builder()
Creates a builder forImmutableTestResult
.static ImmutableTestResult
copyOf
(TestResult instance) Creates an immutable copy of aTestResult
value.boolean
This instance is equal to all instances ofImmutableTestResult
that have equal attribute values.long
getDelay()
boolean
long
getTime()
double
double
int
hashCode()
Computes a hash code from attributes:viralLoadTruth
,time
,testParams
,viralLoadSample
,delay
,finalObservedResult
,trueLogLikelihoodRatio
.Creates a builder forImmutableTestResult
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueTestResult
with attribute values.double
final ImmutableTestResult
withTestParams
(TestParameters value) Copy the current immutable object by setting a value for thetestParams
attribute.final ImmutableTestResult
withTime
(long value) Copy the current immutable object by setting a value for thetime
attribute.final ImmutableTestResult
withViralLoadTruth
(double value) Copy the current immutable object by setting a value for theviralLoadTruth
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.ai4ci.abm.TestResult
isResultAvailable, isResultCurrent, isResultToday, logLikelihoodRatio, logLikelihoodRatio, resultOnDay
-
Method Details
-
getViralLoadTruth
public double getViralLoadTruth()- Specified by:
getViralLoadTruth
in interfaceTestResult
- Returns:
- The value of the
viralLoadTruth
attribute
-
getTime
public long getTime()- Specified by:
getTime
in interfaceTestResult
- Returns:
- The value of the
time
attribute
-
getTestParams
- Specified by:
getTestParams
in interfaceTestResult
- Returns:
- The value of the
testParams
attribute
-
getViralLoadSample
public double getViralLoadSample()- Specified by:
getViralLoadSample
in interfaceTestResult
- Returns:
- The computed-at-construction value of the
viralLoadSample
attribute
-
getDelay
public long getDelay()- Specified by:
getDelay
in interfaceTestResult
- Returns:
- The computed-at-construction value of the
delay
attribute
-
getFinalObservedResult
public boolean getFinalObservedResult()- Specified by:
getFinalObservedResult
in interfaceTestResult
- Returns:
- The computed-at-construction value of the
finalObservedResult
attribute
-
trueLogLikelihoodRatio
public double trueLogLikelihoodRatio()- Specified by:
trueLogLikelihoodRatio
in interfaceTestResult
- Returns:
- The computed-at-construction value of the
trueLogLikelihoodRatio
attribute
-
withViralLoadTruth
Copy the current immutable object by setting a value for theviralLoadTruth
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for viralLoadTruth- Returns:
- A modified copy of the
this
object
-
withTime
Copy the current immutable object by setting a value for thetime
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for time- Returns:
- A modified copy of the
this
object
-
withTestParams
Copy the current immutable object by setting a value for thetestParams
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for testParams- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableTestResult
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:viralLoadTruth
,time
,testParams
,viralLoadSample
,delay
,finalObservedResult
,trueLogLikelihoodRatio
. -
toString
Prints the immutable valueTestResult
with attribute values. -
copyOf
Creates an immutable copy of aTestResult
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable TestResult instance
-
toBuilder
Creates a builder forImmutableTestResult
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableTestResult builder with attributes of
this
instance
-
builder
Creates a builder forImmutableTestResult
.ImmutableTestResult.builder() .setViralLoadTruth(double) // required
viralLoadTruth
.setTime(long) // requiredtime
.setTestParams(io.github.ai4ci.config.TestParameters) // requiredtestParams
.build();- Returns:
- A new ImmutableTestResult builder
-