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:
  • Method Details

    • getViralLoadTruth

      public double getViralLoadTruth()
      Specified by:
      getViralLoadTruth in interface TestResult
      Returns:
      The value of the viralLoadTruth attribute
    • getTime

      public long getTime()
      Specified by:
      getTime in interface TestResult
      Returns:
      The value of the time attribute
    • getTestParams

      public ImmutableTestParameters getTestParams()
      Specified by:
      getTestParams in interface TestResult
      Returns:
      The value of the testParams attribute
    • getViralLoadSample

      public double getViralLoadSample()
      Specified by:
      getViralLoadSample in interface TestResult
      Returns:
      The computed-at-construction value of the viralLoadSample attribute
    • getDelay

      public long getDelay()
      Specified by:
      getDelay in interface TestResult
      Returns:
      The computed-at-construction value of the delay attribute
    • getFinalObservedResult

      public boolean getFinalObservedResult()
      Specified by:
      getFinalObservedResult in interface TestResult
      Returns:
      The computed-at-construction value of the finalObservedResult attribute
    • trueLogLikelihoodRatio

      public double trueLogLikelihoodRatio()
      Specified by:
      trueLogLikelihoodRatio in interface TestResult
      Returns:
      The computed-at-construction value of the trueLogLikelihoodRatio attribute
    • withViralLoadTruth

      public final ImmutableTestResult withViralLoadTruth(double value)
      Copy the current immutable object by setting a value for the viralLoadTruth attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for viralLoadTruth
      Returns:
      A modified copy of the this object
    • withTime

      public final ImmutableTestResult withTime(long value)
      Copy the current immutable object by setting a value for the time attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for time
      Returns:
      A modified copy of the this object
    • withTestParams

      public final ImmutableTestResult withTestParams(TestParameters value)
      Copy the current immutable object by setting a value for the testParams attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for testParams
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTestResult that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: viralLoadTruth, time, testParams, viralLoadSample, delay, finalObservedResult, trueLogLikelihoodRatio.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TestResult with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableTestResult copyOf(TestResult instance)
      Creates an immutable copy of a TestResult 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

      public ImmutableTestResult.Builder toBuilder()
      Creates a builder for ImmutableTestResult.prefilled with attibute values of this instance to easily create modified copies.
      Returns:
      A new ImmutableTestResult builder with attributes of this instance
    • builder

      public static ImmutableTestResult.Builder builder()
      Creates a builder for ImmutableTestResult.
       ImmutableTestResult.builder()
          .setViralLoadTruth(double) // required viralLoadTruth
          .setTime(long) // required time
          .setTestParams(io.github.ai4ci.config.TestParameters) // required testParams
          .build();
       
      Returns:
      A new ImmutableTestResult builder