Package io.github.ai4ci.abm.inhost
Class ImmutableInHostMarkovState.Builder
java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableInHostMarkovState.Builder
- Enclosing class:
- ImmutableInHostMarkovState
Builds instances of type
ImmutableInHostMarkovState
.
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 newImmutableInHostMarkovState
.from
(InHostMarkovState instance) Fill a builder with attribute values from the providedInHostMarkovState
instance.setDiseaseState
(InHostMarkovState.DiseaseState diseaseState) Initializes the value for thediseaseState
attribute.setInfectionCaseRate
(double infectionCaseRate) Initializes the value for theinfectionCaseRate
attribute.setInfectionFatalityRate
(double infectionFatalityRate) Initializes the value for theinfectionFatalityRate
attribute.setInfectionHospitalisationRate
(double infectionHospitalisationRate) Initializes the value for theinfectionHospitalisationRate
attribute.Initializes the value for themachine
attribute.setSymptomState
(InHostMarkovState.SymptomState symptomState) Initializes the value for thesymptomState
attribute.setTime
(int time) Initializes the value for thetime
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder from(InHostMarkovState instance) Fill a builder with attribute values from the providedInHostMarkovState
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
-
setTime
Initializes the value for thetime
attribute.- Parameters:
time
- The value for time- Returns:
this
builder for use in a chained invocation
-
setInfectionCaseRate
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setInfectionCaseRate(double infectionCaseRate) Initializes the value for theinfectionCaseRate
attribute.- Parameters:
infectionCaseRate
- The value for infectionCaseRate- Returns:
this
builder for use in a chained invocation
-
setInfectionHospitalisationRate
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setInfectionHospitalisationRate(double infectionHospitalisationRate) Initializes the value for theinfectionHospitalisationRate
attribute.- Parameters:
infectionHospitalisationRate
- The value for infectionHospitalisationRate- Returns:
this
builder for use in a chained invocation
-
setInfectionFatalityRate
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setInfectionFatalityRate(double infectionFatalityRate) Initializes the value for theinfectionFatalityRate
attribute.- Parameters:
infectionFatalityRate
- The value for infectionFatalityRate- Returns:
this
builder for use in a chained invocation
-
setDiseaseState
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setDiseaseState(InHostMarkovState.DiseaseState diseaseState) Initializes the value for thediseaseState
attribute.- Parameters:
diseaseState
- The value for diseaseState- Returns:
this
builder for use in a chained invocation
-
setSymptomState
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setSymptomState(InHostMarkovState.SymptomState symptomState) Initializes the value for thesymptomState
attribute.- Parameters:
symptomState
- The value for symptomState- Returns:
this
builder for use in a chained invocation
-
setMachine
@CanIgnoreReturnValue public final ImmutableInHostMarkovState.Builder setMachine(InHostMarkovState.InHostMarkovStateMachine machine) Initializes the value for themachine
attribute.- Parameters:
machine
- The value for machine- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableInHostMarkovState
.- Returns:
- An immutable instance of InHostMarkovState
- Throws:
IllegalStateException
- if any required attributes are missing
-