Package io.github.ai4ci.abm.inhost
Class ImmutableExposureModel.Builder
java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableExposureModel.Builder
- Enclosing class:
- ImmutableExposureModel
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 Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableExposureModel
.from
(ExposureModel instance) Fill a builder with attribute values from the providedExposureModel
instance.setDecayOffset
(double decayOffset) Initializes the value for thedecayOffset
attribute.setExposureTime
(int exposureTime) Initializes the value for theexposureTime
attribute.setGrowthOffset
(double growthOffset) Initializes the value for thegrowthOffset
attribute.setImmuneActivityAtExposure
(double immuneActivityAtExposure) Initializes the value for theimmuneActivityAtExposure
attribute.setNormalisedExposure
(double normalisedExposure) Initializes the value for thenormalisedExposure
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedExposureModel
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
Initializes the value for theexposureTime
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 thenormalisedExposure
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 theimmuneActivityAtExposure
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 thegrowthOffset
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 thedecayOffset
attribute.- Parameters:
decayOffset
- The value for decayOffset- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableExposureModel
.- Returns:
- An immutable instance of ExposureModel
- Throws:
IllegalStateException
- if any required attributes are missing
-