Class ImmutableExecutionHistory
java.lang.Object
fr.enedis.chutney.server.core.domain.execution.history.ImmutableExecutionHistory
- All Implemented Interfaces:
ExecutionHistory
@Generated(from="ExecutionHistory",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableExecutionHistory
extends Object
implements ExecutionHistory
Immutable implementation of
ExecutionHistory.
Use the builder to create immutable instances:
ImmutableExecutionHistory.builder().
Use the static factory method to create immutable instances:
ImmutableExecutionHistory.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableExecutionHistory.static final classImmutable implementation ofExecutionHistory.DetachedExecution.static final classImmutable implementation ofExecutionHistory.Execution.static final classImmutable implementation ofExecutionHistory.ExecutionSummary.Nested classes/interfaces inherited from interface fr.enedis.chutney.server.core.domain.execution.history.ExecutionHistory
ExecutionHistory.Attached, ExecutionHistory.ExecutionProperties, ExecutionHistory.WithScenario -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableExecutionHistory.static ImmutableExecutionHistorycopyOf(ExecutionHistory instance) Creates an immutable copy of aExecutionHistoryvalue.booleanThis instance is equal to all instances ofImmutableExecutionHistorythat have equal attribute values.inthashCode()Computes a hash code from attributes:scenarioId,history.com.google.common.collect.ImmutableList<ExecutionHistory.Execution> history()static ImmutableExecutionHistoryof(String scenarioId, Iterable<? extends ExecutionHistory.Execution> history) Construct a new immutableExecutionHistoryinstance.static ImmutableExecutionHistoryof(String scenarioId, List<ExecutionHistory.Execution> history) Construct a new immutableExecutionHistoryinstance.toString()Prints the immutable valueExecutionHistorywith attribute values.withHistory(ExecutionHistory.Execution... elements) Copy the current immutable object with elements that replace the content ofhistory.withHistory(Iterable<? extends ExecutionHistory.Execution> elements) Copy the current immutable object with elements that replace the content ofhistory.withScenarioId(String value) Copy the current immutable object by setting a value for thescenarioIdattribute.
-
Method Details
-
scenarioId
- Specified by:
scenarioIdin interfaceExecutionHistory- Returns:
- The value of the
scenarioIdattribute
-
history
- Specified by:
historyin interfaceExecutionHistory- Returns:
- The value of the
historyattribute
-
withScenarioId
Copy the current immutable object by setting a value for thescenarioIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for scenarioId- Returns:
- A modified copy or the
thisobject
-
withHistory
Copy the current immutable object with elements that replace the content ofhistory.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withHistory
public final ImmutableExecutionHistory withHistory(Iterable<? extends ExecutionHistory.Execution> elements) Copy the current immutable object with elements that replace the content ofhistory. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of history elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableExecutionHistorythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:scenarioId,history. -
toString
Prints the immutable valueExecutionHistorywith attribute values. -
of
public static ImmutableExecutionHistory of(String scenarioId, List<ExecutionHistory.Execution> history) Construct a new immutableExecutionHistoryinstance.- Parameters:
scenarioId- The value for thescenarioIdattributehistory- The value for thehistoryattribute- Returns:
- An immutable ExecutionHistory instance
-
of
public static ImmutableExecutionHistory of(String scenarioId, Iterable<? extends ExecutionHistory.Execution> history) Construct a new immutableExecutionHistoryinstance.- Parameters:
scenarioId- The value for thescenarioIdattributehistory- The value for thehistoryattribute- Returns:
- An immutable ExecutionHistory instance
-
copyOf
Creates an immutable copy of aExecutionHistoryvalue. 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 ExecutionHistory instance
-
builder
Creates a builder forImmutableExecutionHistory.ImmutableExecutionHistory.builder() .scenarioId(String) // requiredscenarioId.addHistory|addAllHistory(fr.enedis.chutney.server.core.domain.execution.history.ExecutionHistory.Execution) //historyelements .build();- Returns:
- A new ImmutableExecutionHistory builder
-