Class ImmutableRiskModel.Builder

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

@NotThreadSafe public static final class ImmutableRiskModel.Builder extends Object
Builds instances of type ImmutableRiskModel. 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 ImmutableRiskModel.Builder from(RiskModel instance)
      Fill a builder with attribute values from the provided RiskModel 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
    • setEntity

      @CanIgnoreReturnValue public final ImmutableRiskModel.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
    • setSymptomKernel

      @CanIgnoreReturnValue public final ImmutableRiskModel.Builder setSymptomKernel(Kernel symptomKernel)
      Initializes the value for the symptomKernel attribute.
      Parameters:
      symptomKernel - The value for symptomKernel
      Returns:
      this builder for use in a chained invocation
    • setTestKernel

      @CanIgnoreReturnValue public final ImmutableRiskModel.Builder setTestKernel(Kernel testKernel)
      Initializes the value for the testKernel attribute.
      Parameters:
      testKernel - The value for testKernel
      Returns:
      this builder for use in a chained invocation
    • setContactsKernel

      @CanIgnoreReturnValue public final ImmutableRiskModel.Builder setContactsKernel(Kernel contactsKernel)
      Initializes the value for the contactsKernel attribute.
      Parameters:
      contactsKernel - The value for contactsKernel
      Returns:
      this builder for use in a chained invocation
    • setDirectLogOdds

      @CanIgnoreReturnValue public final ImmutableRiskModel.Builder setDirectLogOdds(double... directLogOdds)
      Initializes the value for the directLogOdds attribute.

      If not set, this attribute will have a default value as defined by directLogOdds.

      Parameters:
      directLogOdds - The elements for directLogOdds
      Returns:
      this builder for use in a chained invocation
    • setTime

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

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