Class ImmutableBatchConfiguration

java.lang.Object
io.github.ai4ci.config.ImmutableBatchConfiguration
All Implemented Interfaces:
BatchConfiguration

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBatchConfiguration extends Object implements BatchConfiguration
Immutable implementation of BatchConfiguration.

Use the builder to create immutable instances: ImmutableBatchConfiguration.builder().

  • Method Details

    • getUrnBase

      public String getUrnBase()
      Specified by:
      getUrnBase in interface BatchConfiguration
      Returns:
      The value of the urnBase attribute
    • getSimulationDuration

      public int getSimulationDuration()
      Specified by:
      getSimulationDuration in interface BatchConfiguration
      Returns:
      The value of the simulationDuration attribute
    • isSlurmBatch

      public boolean isSlurmBatch()
      Specified by:
      isSlurmBatch in interface BatchConfiguration
      Returns:
      The computed-at-construction value of the slurmBatch attribute
    • getBatchNumber

      public int getBatchNumber()
      Default value will populate from the SLURM_ARRAY_TASK_ID environment variable. Only set this if you know what you are doing
      Specified by:
      getBatchNumber in interface BatchConfiguration
    • getBatchTotal

      public int getBatchTotal()
      Default value will populate from the SLURM_ARRAY_TASK_COUNT environment variable. Only set this if you know what you are doing
      Specified by:
      getBatchTotal in interface BatchConfiguration
    • getBatchName

      public String getBatchName()
      Specified by:
      getBatchName in interface BatchConfiguration
      Returns:
      The computed-at-construction value of the batchName attribute
    • getExporters

      public Exporters[] getExporters()
      Specified by:
      getExporters in interface BatchConfiguration
      Returns:
      A cloned exporters array
    • withUrnBase

      public final ImmutableBatchConfiguration withUrnBase(String value)
      Copy the current immutable object by setting a value for the urnBase attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for urnBase
      Returns:
      A modified copy of the this object
    • withSimulationDuration

      public final ImmutableBatchConfiguration withSimulationDuration(int value)
      Copy the current immutable object by setting a value for the simulationDuration attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for simulationDuration
      Returns:
      A modified copy of the this object
    • withExporters

      public final ImmutableBatchConfiguration withExporters(Exporters... elements)
      Copy the current immutable object with elements that replace the content of exporters. The array is cloned before being saved as attribute values.
      Parameters:
      elements - The non-null elements for exporters
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableBatchConfiguration that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: urnBase, simulationDuration, slurmBatch, batchNumber, batchTotal, batchName, exporters.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value BatchConfiguration with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableBatchConfiguration copyOf(BatchConfiguration instance)
      Creates an immutable copy of a BatchConfiguration value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable BatchConfiguration instance
    • toBuilder

      Creates a builder for ImmutableBatchConfiguration.prefilled with attibute values of this instance to easily create modified copies.
      Returns:
      A new ImmutableBatchConfiguration builder with attributes of this instance
    • builder

      public static ImmutableBatchConfiguration.Builder builder()
      Creates a builder for ImmutableBatchConfiguration.
       ImmutableBatchConfiguration.builder()
          .setUrnBase(String) // optional urnBase
          .setSimulationDuration(int) // required simulationDuration
          .setExporters(io.github.ai4ci.config.Exporters) // optional exporters
          .build();
       
      Returns:
      A new ImmutableBatchConfiguration builder