Class ImmutableTestParameters

java.lang.Object
io.github.ai4ci.config.ImmutableTestParameters
All Implemented Interfaces:
TestParameters, Serializable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTestParameters extends Object implements TestParameters
Immutable implementation of TestParameters.

Use the builder to create immutable instances: ImmutableTestParameters.builder().

See Also:
  • Method Details

    • getTestName

      public String getTestName()
      Identifier for the test type e.g. LFT, PCR, SYMPTOMS
      Specified by:
      getTestName in interface TestParameters
    • getSensitivity

      public Double getSensitivity()
      Specified by:
      getSensitivity in interface TestParameters
      Returns:
      The value of the sensitivity attribute
    • getSpecificity

      public Double getSpecificity()
      Specified by:
      getSpecificity in interface TestParameters
      Returns:
      The value of the specificity attribute
    • getMeanTestDelay

      public Double getMeanTestDelay()
      The average delay in the result becoming available (days)
      Specified by:
      getMeanTestDelay in interface TestParameters
    • getSdTestDelay

      public Double getSdTestDelay()
      The SD of the delay in the result. This will be a log normal
      Specified by:
      getSdTestDelay in interface TestParameters
    • getLimitOfDetection

      public Double getLimitOfDetection()
      Specified by:
      getLimitOfDetection in interface TestParameters
      Returns:
      The value of the limitOfDetection attribute
    • withTestName

      public final ImmutableTestParameters withTestName(String value)
      Copy the current immutable object by setting a value for the testName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for testName
      Returns:
      A modified copy of the this object
    • withSensitivity

      public final ImmutableTestParameters withSensitivity(Double value)
      Copy the current immutable object by setting a value for the sensitivity attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sensitivity
      Returns:
      A modified copy of the this object
    • withSpecificity

      public final ImmutableTestParameters withSpecificity(Double value)
      Copy the current immutable object by setting a value for the specificity attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for specificity
      Returns:
      A modified copy of the this object
    • withMeanTestDelay

      public final ImmutableTestParameters withMeanTestDelay(Double value)
      Copy the current immutable object by setting a value for the meanTestDelay attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for meanTestDelay
      Returns:
      A modified copy of the this object
    • withSdTestDelay

      public final ImmutableTestParameters withSdTestDelay(Double value)
      Copy the current immutable object by setting a value for the sdTestDelay attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sdTestDelay
      Returns:
      A modified copy of the this object
    • withLimitOfDetection

      public final ImmutableTestParameters withLimitOfDetection(Double value)
      Copy the current immutable object by setting a value for the limitOfDetection attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for limitOfDetection
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTestParameters 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: testName, sensitivity, specificity, meanTestDelay, sdTestDelay, limitOfDetection.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableTestParameters copyOf(TestParameters instance)
      Creates an immutable copy of a TestParameters 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 TestParameters instance
    • toBuilder

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

      public static ImmutableTestParameters.Builder builder()
      Creates a builder for ImmutableTestParameters.
       ImmutableTestParameters.builder()
          .setTestName(String) // required testName
          .setSensitivity(Double) // required sensitivity
          .setSpecificity(Double) // required specificity
          .setMeanTestDelay(Double) // required meanTestDelay
          .setSdTestDelay(Double) // required sdTestDelay
          .setLimitOfDetection(Double) // required limitOfDetection
          .build();
       
      Returns:
      A new ImmutableTestParameters builder