Class ImmutableBatchConfiguration.Builder

java.lang.Object
io.github.ai4ci.config.ImmutableBatchConfiguration.Builder
Enclosing class:
ImmutableBatchConfiguration

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

      @CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder setUrnBase(String urnBase)
      Initializes the value for the urnBase attribute.

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

      Parameters:
      urnBase - The value for urnBase
      Returns:
      this builder for use in a chained invocation
    • setSimulationDuration

      @CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder setSimulationDuration(int simulationDuration)
      Initializes the value for the simulationDuration attribute.
      Parameters:
      simulationDuration - The value for simulationDuration
      Returns:
      this builder for use in a chained invocation
    • setExporters

      @CanIgnoreReturnValue public final ImmutableBatchConfiguration.Builder setExporters(Exporters... exporters)
      Initializes the value for the exporters attribute.

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

      Parameters:
      exporters - The elements for exporters
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of BatchConfiguration
      Throws:
      IllegalStateException - if any required attributes are missing