Class ImmutablePersonState.Builder

java.lang.Object
io.github.ai4ci.abm.ImmutablePersonState.Builder
Enclosing class:
ImmutablePersonState

@NotThreadSafe public static final class ImmutablePersonState.Builder extends Object
Builds instances of type ImmutablePersonState. 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 Details

    • from

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder from(PersonTemporalState instance)
      Fill a builder with attribute values from the provided io.github.ai4ci.abm.PersonTemporalState instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder from(PersonState instance)
      Fill a builder with attribute values from the provided io.github.ai4ci.abm.PersonState instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setEntity

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setEntity(Person entity)
      Initializes the value for the entity attribute.
      Parameters:
      entity - The value for entity
      Returns:
      this builder for use in a chained invocation
    • setTime

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setTime(Integer time)
      Initializes the value for the time attribute.
      Parameters:
      time - The value for time
      Returns:
      this builder for use in a chained invocation
    • setTransmissibilityModifier

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setTransmissibilityModifier(double transmissibilityModifier)
      Initializes the value for the transmissibilityModifier attribute.

      If not set, this attribute will have a default value as returned by the initializer of transmissibilityModifier.

      Parameters:
      transmissibilityModifier - The value for transmissibilityModifier
      Returns:
      this builder for use in a chained invocation
    • setMobilityModifier

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setMobilityModifier(double mobilityModifier)
      Initializes the value for the mobilityModifier attribute.

      If not set, this attribute will have a default value as returned by the initializer of mobilityModifier.

      Parameters:
      mobilityModifier - The value for mobilityModifier
      Returns:
      this builder for use in a chained invocation
    • setComplianceModifier

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setComplianceModifier(double complianceModifier)
      Initializes the value for the complianceModifier attribute.

      If not set, this attribute will have a default value as returned by the initializer of complianceModifier.

      Parameters:
      complianceModifier - The value for complianceModifier
      Returns:
      this builder for use in a chained invocation
    • setSusceptibilityModifier

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setSusceptibilityModifier(double susceptibilityModifier)
      Initializes the value for the susceptibilityModifier attribute.

      If not set, this attribute will have a default value as returned by the initializer of susceptibilityModifier.

      Parameters:
      susceptibilityModifier - The value for susceptibilityModifier
      Returns:
      this builder for use in a chained invocation
    • setAppUseModifier

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setAppUseModifier(double appUseModifier)
      Initializes the value for the appUseModifier attribute.

      If not set, this attribute will have a default value as returned by the initializer of appUseModifier.

      Parameters:
      appUseModifier - The value for appUseModifier
      Returns:
      this builder for use in a chained invocation
    • setImportationExposure

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setImportationExposure(double importationExposure)
      Initializes the value for the importationExposure attribute.

      If not set, this attribute will have a default value as returned by the initializer of importationExposure.

      Parameters:
      importationExposure - The value for importationExposure
      Returns:
      this builder for use in a chained invocation
    • setImmunisationDose

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setImmunisationDose(double immunisationDose)
      Initializes the value for the immunisationDose attribute.

      If not set, this attribute will have a default value as returned by the initializer of immunisationDose.

      Parameters:
      immunisationDose - The value for immunisationDose
      Returns:
      this builder for use in a chained invocation
    • setInHostModel

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setInHostModel(InHostModelState<?> inHostModel)
      Initializes the value for the inHostModel attribute.
      Parameters:
      inHostModel - The value for inHostModel
      Returns:
      this builder for use in a chained invocation
    • setRiskModel

      @CanIgnoreReturnValue public final ImmutablePersonState.Builder setRiskModel(RiskModel riskModel)
      Initializes the value for the riskModel attribute.

      If not set, this attribute will have a default value as returned by the initializer of riskModel.

      Parameters:
      riskModel - The value for riskModel
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePersonState build()
      Builds a new ImmutablePersonState.
      Returns:
      An immutable instance of PersonState
      Throws:
      IllegalStateException - if any required attributes are missing