Class ImmutableExposureModel

java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableExposureModel
All Implemented Interfaces:
ExposureModel, Serializable

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

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

See Also:
  • Method Details

    • getExposureTime

      public int getExposureTime()
      Specified by:
      getExposureTime in interface ExposureModel
      Returns:
      The value of the exposureTime attribute
    • getNormalisedExposure

      public double getNormalisedExposure()
      Specified by:
      getNormalisedExposure in interface ExposureModel
      Returns:
      The value of the normalisedExposure attribute
    • getImmuneActivityAtExposure

      public double getImmuneActivityAtExposure()
      Specified by:
      getImmuneActivityAtExposure in interface ExposureModel
      Returns:
      The value of the immuneActivityAtExposure attribute
    • getGrowthOffset

      public double getGrowthOffset()
      Specified by:
      getGrowthOffset in interface ExposureModel
      Returns:
      The value of the growthOffset attribute
    • getDecayOffset

      public double getDecayOffset()
      Specified by:
      getDecayOffset in interface ExposureModel
      Returns:
      The value of the decayOffset attribute
    • withExposureTime

      public final ImmutableExposureModel withExposureTime(int value)
      Copy the current immutable object by setting a value for the exposureTime attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for exposureTime
      Returns:
      A modified copy of the this object
    • withNormalisedExposure

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

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableExposureModel 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: exposureTime, normalisedExposure, immuneActivityAtExposure, growthOffset, decayOffset.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

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

      public static ImmutableExposureModel.Builder builder()
      Creates a builder for ImmutableExposureModel.
       ImmutableExposureModel.builder()
          .setExposureTime(int) // required exposureTime
          .setNormalisedExposure(double) // required normalisedExposure
          .setImmuneActivityAtExposure(double) // required immuneActivityAtExposure
          .setGrowthOffset(double) // required growthOffset
          .setDecayOffset(double) // required decayOffset
          .build();
       
      Returns:
      A new ImmutableExposureModel builder