Class ImmutablePersonHistory.Builder

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

@NotThreadSafe public static final class ImmutablePersonHistory.Builder extends Object
Builds instances of type ImmutablePersonHistory. 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 ImmutablePersonHistory.Builder from(PersonHistory instance)
      Fill a builder with attribute values from the provided io.github.ai4ci.abm.PersonHistory instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final ImmutablePersonHistory.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
    • setEntity

      @CanIgnoreReturnValue public final ImmutablePersonHistory.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 ImmutablePersonHistory.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
    • setInfectious

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setInfectious(boolean infectious)
      Initializes the value for the infectious attribute.
      Parameters:
      infectious - The value for infectious
      Returns:
      this builder for use in a chained invocation
    • setSymptomatic

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setSymptomatic(boolean symptomatic)
      Initializes the value for the symptomatic attribute.
      Parameters:
      symptomatic - The value for symptomatic
      Returns:
      this builder for use in a chained invocation
    • setReportedSymptomatic

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setReportedSymptomatic(boolean reportedSymptomatic)
      Initializes the value for the reportedSymptomatic attribute.
      Parameters:
      reportedSymptomatic - The value for reportedSymptomatic
      Returns:
      this builder for use in a chained invocation
    • setRequiringHospitalisation

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setRequiringHospitalisation(boolean requiringHospitalisation)
      Initializes the value for the requiringHospitalisation attribute.
      Parameters:
      requiringHospitalisation - The value for requiringHospitalisation
      Returns:
      this builder for use in a chained invocation
    • setDead

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setDead(boolean dead)
      Initializes the value for the dead attribute.
      Parameters:
      dead - The value for dead
      Returns:
      this builder for use in a chained invocation
    • setNormalisedSeverity

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setNormalisedSeverity(double normalisedSeverity)
      Initializes the value for the normalisedSeverity attribute.
      Parameters:
      normalisedSeverity - The value for normalisedSeverity
      Returns:
      this builder for use in a chained invocation
    • setNormalisedViralLoad

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setNormalisedViralLoad(double normalisedViralLoad)
      Initializes the value for the normalisedViralLoad attribute.
      Parameters:
      normalisedViralLoad - The value for normalisedViralLoad
      Returns:
      this builder for use in a chained invocation
    • setContactExposure

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setContactExposure(double contactExposure)
      Initializes the value for the contactExposure attribute.
      Parameters:
      contactExposure - The value for contactExposure
      Returns:
      this builder for use in a chained invocation
    • setPresumedLocalPrevalence

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setPresumedLocalPrevalence(double presumedLocalPrevalence)
      Initializes the value for the presumedLocalPrevalence attribute.
      Parameters:
      presumedLocalPrevalence - The value for presumedLocalPrevalence
      Returns:
      this builder for use in a chained invocation
    • addTodaysTest

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder addTodaysTest(TestResult element)
      Adds one element to todaysTests list.
      Parameters:
      element - A todaysTests element
      Returns:
      this builder for use in a chained invocation
    • addTodaysTests

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder addTodaysTests(TestResult... elements)
      Adds elements to todaysTests list.
      Parameters:
      elements - An array of todaysTests elements
      Returns:
      this builder for use in a chained invocation
    • setTodaysTests

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setTodaysTests(Iterable<? extends TestResult> elements)
      Sets or replaces all elements for todaysTests list.
      Parameters:
      elements - An iterable of todaysTests elements
      Returns:
      this builder for use in a chained invocation
    • addAllTodaysTests

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder addAllTodaysTests(Iterable<? extends TestResult> elements)
      Adds elements to todaysTests list.
      Parameters:
      elements - An iterable of todaysTests elements
      Returns:
      this builder for use in a chained invocation
    • setTodaysContacts

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setTodaysContacts(Contact... todaysContacts)
      Initializes the value for the todaysContacts attribute.
      Parameters:
      todaysContacts - The elements for todaysContacts
      Returns:
      this builder for use in a chained invocation
    • setTodaysExposures

      @CanIgnoreReturnValue public final ImmutablePersonHistory.Builder setTodaysExposures(Exposure... todaysExposures)
      Initializes the value for the todaysExposures attribute.
      Parameters:
      todaysExposures - The elements for todaysExposures
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePersonHistory build()
      Returns:
      An immutable instance of PersonHistory
      Throws:
      IllegalStateException - if any required attributes are missing