Package io.github.ai4ci.abm.inhost
Class ImmutableInHostPhenomenologicalState.Builder
java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableInHostPhenomenologicalState.Builder
- Enclosing class:
- ImmutableInHostPhenomenologicalState
@NotThreadSafe
public static final class ImmutableInHostPhenomenologicalState.Builder
extends Object
Builds instances of type
ImmutableInHostPhenomenologicalState
.
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 TypeMethodDescriptionaddAllExposures
(Iterable<? extends ExposureModel> elements) Adds elements toexposures
list.addExposure
(ExposureModel element) Adds one element toexposures
list.addExposures
(ExposureModel... elements) Adds elements toexposures
list.build()
Builds a newImmutableInHostPhenomenologicalState
.from
(InHostPhenomenologicalState instance) Fill a builder with attribute values from the providedInHostPhenomenologicalState
instance.setExposures
(Iterable<? extends ExposureModel> elements) Sets or replaces all elements forexposures
list.setImmunityModel
(ExposureModel.BiPhasicLogistic immunityModel) Initializes the value for theimmunityModel
attribute.setInfectiousnessCutoff
(double infectiousnessCutoff) Initializes the value for theinfectiousnessCutoff
attribute.setTime
(int time) Initializes the value for thetime
attribute.setViralLoadModel
(ExposureModel.BiPhasicLogistic viralLoadModel) Initializes the value for theviralLoadModel
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder from(InHostPhenomenologicalState instance) Fill a builder with attribute values from the providedInHostPhenomenologicalState
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setViralLoadModel
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder setViralLoadModel(ExposureModel.BiPhasicLogistic viralLoadModel) Initializes the value for theviralLoadModel
attribute.- Parameters:
viralLoadModel
- The value for viralLoadModel- Returns:
this
builder for use in a chained invocation
-
setImmunityModel
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder setImmunityModel(ExposureModel.BiPhasicLogistic immunityModel) Initializes the value for theimmunityModel
attribute.- Parameters:
immunityModel
- The value for immunityModel- Returns:
this
builder for use in a chained invocation
-
addExposure
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder addExposure(ExposureModel element) Adds one element toexposures
list.- Parameters:
element
- A exposures element- Returns:
this
builder for use in a chained invocation
-
addExposures
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder addExposures(ExposureModel... elements) Adds elements toexposures
list.- Parameters:
elements
- An array of exposures elements- Returns:
this
builder for use in a chained invocation
-
setExposures
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder setExposures(Iterable<? extends ExposureModel> elements) Sets or replaces all elements forexposures
list.- Parameters:
elements
- An iterable of exposures elements- Returns:
this
builder for use in a chained invocation
-
addAllExposures
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder addAllExposures(Iterable<? extends ExposureModel> elements) Adds elements toexposures
list.- Parameters:
elements
- An iterable of exposures elements- Returns:
this
builder for use in a chained invocation
-
setInfectiousnessCutoff
@CanIgnoreReturnValue public final ImmutableInHostPhenomenologicalState.Builder setInfectiousnessCutoff(double infectiousnessCutoff) Initializes the value for theinfectiousnessCutoff
attribute.- Parameters:
infectiousnessCutoff
- The value for infectiousnessCutoff- Returns:
this
builder for use in a chained invocation
-
setTime
Initializes the value for thetime
attribute.- Parameters:
time
- The value for time- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableInHostPhenomenologicalState
.- Returns:
- An immutable instance of InHostPhenomenologicalState
- Throws:
IllegalStateException
- if any required attributes are missing
-