Package io.github.ai4ci.config
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()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableBatchConfiguration
. -
Field Summary
Fields inherited from interface io.github.ai4ci.config.BatchConfiguration
DEFAULT, log
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableBatchConfiguration
.static ImmutableBatchConfiguration
copyOf
(BatchConfiguration instance) Creates an immutable copy of aBatchConfiguration
value.boolean
This instance is equal to all instances ofImmutableBatchConfiguration
that have equal attribute values.int
Default value will populate from the SLURM_ARRAY_TASK_ID environment variable.int
Default value will populate from the SLURM_ARRAY_TASK_COUNT environment variable.int
int
hashCode()
Computes a hash code from attributes:urnBase
,simulationDuration
,slurmBatch
,batchNumber
,batchTotal
,batchName
,exporters
.boolean
Creates a builder forImmutableBatchConfiguration
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueBatchConfiguration
with attribute values.withExporters
(Exporters... elements) Copy the current immutable object with elements that replace the content ofexporters
.withSimulationDuration
(int value) Copy the current immutable object by setting a value for thesimulationDuration
attribute.withUrnBase
(String value) Copy the current immutable object by setting a value for theurnBase
attribute.
-
Method Details
-
getUrnBase
- Specified by:
getUrnBase
in interfaceBatchConfiguration
- Returns:
- The value of the
urnBase
attribute
-
getSimulationDuration
public int getSimulationDuration()- Specified by:
getSimulationDuration
in interfaceBatchConfiguration
- Returns:
- The value of the
simulationDuration
attribute
-
isSlurmBatch
public boolean isSlurmBatch()- Specified by:
isSlurmBatch
in interfaceBatchConfiguration
- 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 interfaceBatchConfiguration
-
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 interfaceBatchConfiguration
-
getBatchName
- Specified by:
getBatchName
in interfaceBatchConfiguration
- Returns:
- The computed-at-construction value of the
batchName
attribute
-
getExporters
- Specified by:
getExporters
in interfaceBatchConfiguration
- Returns:
- A cloned
exporters
array
-
withUrnBase
Copy the current immutable object by setting a value for theurnBase
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for urnBase- Returns:
- A modified copy of the
this
object
-
withSimulationDuration
Copy the current immutable object by setting a value for thesimulationDuration
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for simulationDuration- Returns:
- A modified copy of the
this
object
-
withExporters
Copy the current immutable object with elements that replace the content ofexporters
. 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
This instance is equal to all instances ofImmutableBatchConfiguration
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:urnBase
,simulationDuration
,slurmBatch
,batchNumber
,batchTotal
,batchName
,exporters
. -
toString
Prints the immutable valueBatchConfiguration
with attribute values. -
copyOf
Creates an immutable copy of aBatchConfiguration
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 forImmutableBatchConfiguration
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableBatchConfiguration builder with attributes of
this
instance
-
builder
Creates a builder forImmutableBatchConfiguration
.ImmutableBatchConfiguration.builder() .setUrnBase(String) // optional
urnBase
.setSimulationDuration(int) // requiredsimulationDuration
.setExporters(io.github.ai4ci.config.Exporters) // optionalexporters
.build();- Returns:
- A new ImmutableBatchConfiguration builder
-