Class ImmutableExposureModel.Builder

java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableExposureModel.Builder
Enclosing class:
ImmutableExposureModel

@NotThreadSafe public static final class ImmutableExposureModel.Builder extends Object
Builds instances of type ImmutableExposureModel. 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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder from(ExposureModel instance)
      Fill a builder with attribute values from the provided ExposureModel 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
    • setExposureTime

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder setExposureTime(int exposureTime)
      Initializes the value for the exposureTime attribute.
      Parameters:
      exposureTime - The value for exposureTime
      Returns:
      this builder for use in a chained invocation
    • setNormalisedExposure

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder setNormalisedExposure(double normalisedExposure)
      Initializes the value for the normalisedExposure attribute.
      Parameters:
      normalisedExposure - The value for normalisedExposure
      Returns:
      this builder for use in a chained invocation
    • setImmuneActivityAtExposure

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder setImmuneActivityAtExposure(double immuneActivityAtExposure)
      Initializes the value for the immuneActivityAtExposure attribute.
      Parameters:
      immuneActivityAtExposure - The value for immuneActivityAtExposure
      Returns:
      this builder for use in a chained invocation
    • setGrowthOffset

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder setGrowthOffset(double growthOffset)
      Initializes the value for the growthOffset attribute.
      Parameters:
      growthOffset - The value for growthOffset
      Returns:
      this builder for use in a chained invocation
    • setDecayOffset

      @CanIgnoreReturnValue public final ImmutableExposureModel.Builder setDecayOffset(double decayOffset)
      Initializes the value for the decayOffset attribute.
      Parameters:
      decayOffset - The value for decayOffset
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableExposureModel build()
      Returns:
      An immutable instance of ExposureModel
      Throws:
      IllegalStateException - if any required attributes are missing