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().

  • Method Details

    • scenarioId

      public String scenarioId()
      Specified by:
      scenarioId in interface ExecutionHistory
      Returns:
      The value of the scenarioId attribute
    • history

      public com.google.common.collect.ImmutableList<ExecutionHistory.Execution> history()
      Specified by:
      history in interface ExecutionHistory
      Returns:
      The value of the history attribute
    • withScenarioId

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

      public final ImmutableExecutionHistory withHistory(ExecutionHistory.Execution... elements)
      Copy the current immutable object with elements that replace the content of history.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withHistory

      public final ImmutableExecutionHistory withHistory(Iterable<? extends ExecutionHistory.Execution> elements)
      Copy the current immutable object with elements that replace the content of history. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of history elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableExecutionHistory 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: scenarioId, history.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableExecutionHistory of(String scenarioId, List<ExecutionHistory.Execution> history)
      Construct a new immutable ExecutionHistory instance.
      Parameters:
      scenarioId - The value for the scenarioId attribute
      history - The value for the history attribute
      Returns:
      An immutable ExecutionHistory instance
    • of

      public static ImmutableExecutionHistory of(String scenarioId, Iterable<? extends ExecutionHistory.Execution> history)
      Construct a new immutable ExecutionHistory instance.
      Parameters:
      scenarioId - The value for the scenarioId attribute
      history - The value for the history attribute
      Returns:
      An immutable ExecutionHistory instance
    • copyOf

      public static ImmutableExecutionHistory copyOf(ExecutionHistory instance)
      Creates an immutable copy of a ExecutionHistory 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 ExecutionHistory instance
    • builder

      public static ImmutableExecutionHistory.Builder builder()
      Creates a builder for ImmutableExecutionHistory.
       ImmutableExecutionHistory.builder()
          .scenarioId(String) // required scenarioId
          .addHistory|addAllHistory(fr.enedis.chutney.server.core.domain.execution.history.ExecutionHistory.Execution) // history elements
          .build();
       
      Returns:
      A new ImmutableExecutionHistory builder