Package io.github.ai4ci.abm
Class ImmutableOutbreakBaseline.Builder
java.lang.Object
io.github.ai4ci.abm.ImmutableOutbreakBaseline.Builder
- Enclosing class:
- ImmutableOutbreakBaseline
Builds instances of type
ImmutableOutbreakBaseline
.
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 newImmutableOutbreakBaseline
.from
(OutbreakBaseline instance) Fill a builder with attribute values from the providedOutbreakBaseline
instance.setDefaultPolicyState
(StateMachine.PolicyState defaultPolicyState) Initializes the value for thedefaultPolicyState
attribute.setExpectedContactsPerPersonPerDay
(double expectedContactsPerPersonPerDay) Initializes the value for theexpectedContactsPerPersonPerDay
attribute.setInfectiveDuration
(int infectiveDuration) Initializes the value for theinfectiveDuration
attribute.setSeverityDeathCutoff
(double severityDeathCutoff) Initializes the value for theseverityDeathCutoff
attribute.setSeverityHospitalisationCutoff
(double severityHospitalisationCutoff) Initializes the value for theseverityHospitalisationCutoff
attribute.setSeveritySymptomsCutoff
(double severitySymptomsCutoff) Initializes the value for theseveritySymptomsCutoff
attribute.setSymptomDuration
(int symptomDuration) Initializes the value for thesymptomDuration
attribute.setViralLoadTransmissibilityProbabilityFactor
(double viralLoadTransmissibilityProbabilityFactor) Initializes the value for theviralLoadTransmissibilityProbabilityFactor
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder from(OutbreakBaseline instance) Fill a builder with attribute values from the providedOutbreakBaseline
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
-
setViralLoadTransmissibilityProbabilityFactor
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setViralLoadTransmissibilityProbabilityFactor(double viralLoadTransmissibilityProbabilityFactor) Initializes the value for theviralLoadTransmissibilityProbabilityFactor
attribute.- Parameters:
viralLoadTransmissibilityProbabilityFactor
- The value for viralLoadTransmissibilityProbabilityFactor- Returns:
this
builder for use in a chained invocation
-
setExpectedContactsPerPersonPerDay
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setExpectedContactsPerPersonPerDay(double expectedContactsPerPersonPerDay) Initializes the value for theexpectedContactsPerPersonPerDay
attribute.- Parameters:
expectedContactsPerPersonPerDay
- The value for expectedContactsPerPersonPerDay- Returns:
this
builder for use in a chained invocation
-
setSeveritySymptomsCutoff
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setSeveritySymptomsCutoff(double severitySymptomsCutoff) Initializes the value for theseveritySymptomsCutoff
attribute.- Parameters:
severitySymptomsCutoff
- The value for severitySymptomsCutoff- Returns:
this
builder for use in a chained invocation
-
setSeverityHospitalisationCutoff
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setSeverityHospitalisationCutoff(double severityHospitalisationCutoff) Initializes the value for theseverityHospitalisationCutoff
attribute.- Parameters:
severityHospitalisationCutoff
- The value for severityHospitalisationCutoff- Returns:
this
builder for use in a chained invocation
-
setSeverityDeathCutoff
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setSeverityDeathCutoff(double severityDeathCutoff) Initializes the value for theseverityDeathCutoff
attribute.- Parameters:
severityDeathCutoff
- The value for severityDeathCutoff- Returns:
this
builder for use in a chained invocation
-
setDefaultPolicyState
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setDefaultPolicyState(StateMachine.PolicyState defaultPolicyState) Initializes the value for thedefaultPolicyState
attribute.- Parameters:
defaultPolicyState
- The value for defaultPolicyState- Returns:
this
builder for use in a chained invocation
-
setInfectiveDuration
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setInfectiveDuration(int infectiveDuration) Initializes the value for theinfectiveDuration
attribute.- Parameters:
infectiveDuration
- The value for infectiveDuration- Returns:
this
builder for use in a chained invocation
-
setSymptomDuration
@CanIgnoreReturnValue public final ImmutableOutbreakBaseline.Builder setSymptomDuration(int symptomDuration) Initializes the value for thesymptomDuration
attribute.- Parameters:
symptomDuration
- The value for symptomDuration- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableOutbreakBaseline
.- Returns:
- An immutable instance of OutbreakBaseline
- Throws:
IllegalStateException
- if any required attributes are missing
-