Class ImmutableExecutionHistory.Builder
java.lang.Object
fr.enedis.chutney.server.core.domain.execution.history.ImmutableExecutionHistory.Builder
- Enclosing class:
ImmutableExecutionHistory
@Generated(from="ExecutionHistory",
generator="Immutables")
@NotThreadSafe
public static final class ImmutableExecutionHistory.Builder
extends Object
Builds instances of type
ImmutableExecutionHistory.
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 Summary
Modifier and TypeMethodDescriptionaddAllHistory(Iterable<? extends ExecutionHistory.Execution> elements) Adds elements tohistorylist.addHistory(ExecutionHistory.Execution element) Adds one element tohistorylist.addHistory(ExecutionHistory.Execution... elements) Adds elements tohistorylist.build()Builds a newImmutableExecutionHistory.from(ExecutionHistory instance) Fill a builder with attribute values from the providedExecutionHistoryinstance.history(Iterable<? extends ExecutionHistory.Execution> elements) Sets or replaces all elements forhistorylist.scenarioId(String scenarioId) Initializes the value for thescenarioIdattribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder from(ExecutionHistory instance) Fill a builder with attribute values from the providedExecutionHistoryinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
scenarioId
Initializes the value for thescenarioIdattribute.- Parameters:
scenarioId- The value for scenarioId- Returns:
thisbuilder for use in a chained invocation
-
addHistory
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder addHistory(ExecutionHistory.Execution element) Adds one element tohistorylist.- Parameters:
element- A history element- Returns:
thisbuilder for use in a chained invocation
-
addHistory
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder addHistory(ExecutionHistory.Execution... elements) Adds elements tohistorylist.- Parameters:
elements- An array of history elements- Returns:
thisbuilder for use in a chained invocation
-
history
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder history(Iterable<? extends ExecutionHistory.Execution> elements) Sets or replaces all elements forhistorylist.- Parameters:
elements- An iterable of history elements- Returns:
thisbuilder for use in a chained invocation
-
addAllHistory
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder addAllHistory(Iterable<? extends ExecutionHistory.Execution> elements) Adds elements tohistorylist.- Parameters:
elements- An iterable of history elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableExecutionHistory.- Returns:
- An immutable instance of ExecutionHistory
- Throws:
IllegalStateException- if any required attributes are missing
-