Class ImmutableExecutionHistory.ExecutionSummary

java.lang.Object
fr.enedis.chutney.server.core.domain.execution.history.ImmutableExecutionHistory.ExecutionSummary
All Implemented Interfaces:
ExecutionHistory.Attached, ExecutionHistory.ExecutionProperties, ExecutionHistory.ExecutionSummary, ExecutionHistory.WithScenario
Enclosing class:
ImmutableExecutionHistory

@Generated(from="ExecutionHistory.ExecutionSummary", generator="Immutables") @Immutable @CheckReturnValue public static final class ImmutableExecutionHistory.ExecutionSummary extends Object implements ExecutionHistory.ExecutionSummary
Immutable implementation of ExecutionHistory.ExecutionSummary.

Use the builder to create immutable instances: ImmutableExecutionHistory.ExecutionSummary.builder().

  • Method Details

    • time

      public LocalDateTime time()
      Specified by:
      time in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the time attribute
    • duration

      public long duration()
      Specified by:
      duration in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the duration attribute
    • status

      public ServerReportStatus status()
      Specified by:
      status in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the status attribute
    • info

      public Optional<String> info()
      Specified by:
      info in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the info attribute
    • error

      public Optional<String> error()
      Specified by:
      error in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the error attribute
    • testCaseTitle

      public String testCaseTitle()
      Specified by:
      testCaseTitle in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the testCaseTitle attribute
    • environment

      public String environment()
      Specified by:
      environment in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the environment attribute
    • dataset

      public Optional<DataSet> dataset()
      Specified by:
      dataset in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the dataset attribute
    • user

      public String user()
      Specified by:
      user in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the user attribute
    • campaignReport

      public Optional<CampaignExecution> campaignReport()
      Specified by:
      campaignReport in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the campaignReport attribute
    • tags

      public Optional<Set<String>> tags()
      Specified by:
      tags in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the tags attribute
    • executionId

      public Long executionId()
      Specified by:
      executionId in interface ExecutionHistory.Attached
      Returns:
      The value of the executionId attribute
    • scenarioId

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

      Copy the current immutable object by setting a value for the time attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for time
      Returns:
      A modified copy or the this object
    • withDuration

      public final ImmutableExecutionHistory.ExecutionSummary withDuration(long value)
      Copy the current immutable object by setting a value for the duration attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for duration
      Returns:
      A modified copy or the this object
    • withStatus

      Copy the current immutable object by setting a value for the status attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for status
      Returns:
      A modified copy or the this object
    • withInfo

      public final ImmutableExecutionHistory.ExecutionSummary withInfo(String value)
      Copy the current immutable object by setting a present value for the optional info attribute.
      Parameters:
      value - The value for info
      Returns:
      A modified copy or this if not changed
    • withInfo

      public final ImmutableExecutionHistory.ExecutionSummary withInfo(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the info attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for info
      Returns:
      A modified copy or this if not changed
    • withError

      public final ImmutableExecutionHistory.ExecutionSummary withError(String value)
      Copy the current immutable object by setting a present value for the optional error attribute.
      Parameters:
      value - The value for error
      Returns:
      A modified copy or this if not changed
    • withError

      public final ImmutableExecutionHistory.ExecutionSummary withError(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the error attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for error
      Returns:
      A modified copy or this if not changed
    • withTestCaseTitle

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

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

      public final ImmutableExecutionHistory.ExecutionSummary withDataset(DataSet value)
      Copy the current immutable object by setting a present value for the optional dataset attribute.
      Parameters:
      value - The value for dataset
      Returns:
      A modified copy or this if not changed
    • withDataset

      public final ImmutableExecutionHistory.ExecutionSummary withDataset(Optional<? extends DataSet> optional)
      Copy the current immutable object by setting an optional value for the dataset attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for dataset
      Returns:
      A modified copy or this if not changed
    • withUser

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

      public final ImmutableExecutionHistory.ExecutionSummary withCampaignReport(CampaignExecution value)
      Copy the current immutable object by setting a present value for the optional campaignReport attribute.
      Parameters:
      value - The value for campaignReport
      Returns:
      A modified copy or this if not changed
    • withCampaignReport

      public final ImmutableExecutionHistory.ExecutionSummary withCampaignReport(Optional<? extends CampaignExecution> optional)
      Copy the current immutable object by setting an optional value for the campaignReport attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for campaignReport
      Returns:
      A modified copy or this if not changed
    • withTags

      public final ImmutableExecutionHistory.ExecutionSummary withTags(Set<String> value)
      Copy the current immutable object by setting a present value for the optional tags attribute.
      Parameters:
      value - The value for tags
      Returns:
      A modified copy or this if not changed
    • withTags

      public final ImmutableExecutionHistory.ExecutionSummary withTags(Optional<? extends Set<String>> optional)
      Copy the current immutable object by setting an optional value for the tags attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for tags
      Returns:
      A modified copy or this if not changed
    • withExecutionId

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

      public final ImmutableExecutionHistory.ExecutionSummary 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ExecutionSummary 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: time, duration, status, info, error, testCaseTitle, environment, dataset, user, campaignReport, tags, executionId, scenarioId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a ExecutionHistory.ExecutionSummary 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 ExecutionSummary instance
    • builder

      Creates a builder for ExecutionSummary.
       ImmutableExecutionHistory.ExecutionSummary.builder()
          .time(java.time.LocalDateTime) // required time
          .duration(long) // required duration
          .status(fr.enedis.chutney.server.core.domain.execution.report.ServerReportStatus) // required status
          .info(Optional<String>) // optional info
          .error(Optional<String>) // optional error
          .testCaseTitle(String) // required testCaseTitle
          .environment(String) // required environment
          .dataset(Optional<fr.enedis.chutney.server.core.domain.dataset.DataSet>) // optional dataset
          .user(String) // required user
          .campaignReport(Optional<fr.enedis.chutney.server.core.domain.scenario.campaign.CampaignExecution>) // optional campaignReport
          .tags(Optional<Set<String>>) // optional tags
          .executionId(Long) // required executionId
          .scenarioId(String) // required scenarioId
          .build();
       
      Returns:
      A new ExecutionSummary builder