Class ImmutableExecutionHistory.Builder
- java.lang.Object
-
- com.chutneytesting.server.core.domain.execution.history.ImmutableExecutionHistory.Builder
-
- Enclosing class:
- ImmutableExecutionHistory
@NotThreadSafe public static final class ImmutableExecutionHistory.Builder extends Object
Builds instances of typeImmutableExecutionHistory. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableExecutionHistory.BuilderaddAllHistory(Iterable<? extends ExecutionHistory.Execution> elements)Adds elements tohistorylist.ImmutableExecutionHistory.BuilderaddHistory(ExecutionHistory.Execution element)Adds one element tohistorylist.ImmutableExecutionHistory.BuilderaddHistory(ExecutionHistory.Execution... elements)Adds elements tohistorylist.ImmutableExecutionHistorybuild()Builds a newImmutableExecutionHistory.ImmutableExecutionHistory.Builderfrom(ExecutionHistory instance)Fill a builder with attribute values from the providedExecutionHistoryinstance.ImmutableExecutionHistory.Builderhistory(Iterable<? extends ExecutionHistory.Execution> elements)Sets or replaces all elements forhistorylist.ImmutableExecutionHistory.BuilderscenarioId(String scenarioId)Initializes the value for thescenarioIdattribute.
-
-
-
Method Detail
-
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
@CanIgnoreReturnValue public final ImmutableExecutionHistory.Builder scenarioId(String 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
public ImmutableExecutionHistory build()
Builds a newImmutableExecutionHistory.- Returns:
- An immutable instance of ExecutionHistory
- Throws:
IllegalStateException- if any required attributes are missing
-
-