Class ImmutableExecutionHistory.Execution

java.lang.Object
com.chutneytesting.server.core.domain.execution.history.ImmutableExecutionHistory.Execution
All Implemented Interfaces:
ExecutionHistory.Attached, ExecutionHistory.Execution, ExecutionHistory.ExecutionProperties, ExecutionHistory.WithScenario
Enclosing class:
ImmutableExecutionHistory

@Immutable @CheckReturnValue public static final class ImmutableExecutionHistory.Execution extends Object implements ExecutionHistory.Execution
Immutable implementation of ExecutionHistory.Execution.

Use the builder to create immutable instances: ImmutableExecutionHistory.Execution.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
    • datasetId

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

      public Optional<Integer> datasetVersion()
      Specified by:
      datasetVersion in interface ExecutionHistory.ExecutionProperties
      Returns:
      The value of the datasetVersion 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
    • report

      public String report()
      Returns:
      The value of the report 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

      public final ImmutableExecutionHistory.Execution withTime(LocalDateTime value)
      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 of the this object
    • withDuration

      public final ImmutableExecutionHistory.Execution 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 of 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 of the this object
    • withInfo

      public final ImmutableExecutionHistory.Execution 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 of this object
    • withInfo

      public final ImmutableExecutionHistory.Execution 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 nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for info
      Returns:
      A modified copy of this object
    • withError

      public final ImmutableExecutionHistory.Execution 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 of this object
    • withError

      public final ImmutableExecutionHistory.Execution 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 nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for error
      Returns:
      A modified copy of this object
    • withTestCaseTitle

      public final ImmutableExecutionHistory.Execution 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 of the this object
    • withEnvironment

      public final ImmutableExecutionHistory.Execution 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 of the this object
    • withDatasetId

      public final ImmutableExecutionHistory.Execution withDatasetId(String value)
      Copy the current immutable object by setting a present value for the optional datasetId attribute.
      Parameters:
      value - The value for datasetId
      Returns:
      A modified copy of this object
    • withDatasetId

      public final ImmutableExecutionHistory.Execution withDatasetId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the datasetId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datasetId
      Returns:
      A modified copy of this object
    • withDatasetVersion

      public final ImmutableExecutionHistory.Execution withDatasetVersion(int value)
      Copy the current immutable object by setting a present value for the optional datasetVersion attribute.
      Parameters:
      value - The value for datasetVersion
      Returns:
      A modified copy of this object
    • withDatasetVersion

      public final ImmutableExecutionHistory.Execution withDatasetVersion(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the datasetVersion attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datasetVersion
      Returns:
      A modified copy of this object
    • withUser

      public final ImmutableExecutionHistory.Execution 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 of the this object
    • withCampaignReport

      public final ImmutableExecutionHistory.Execution 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 of this object
    • withCampaignReport

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

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

      public final ImmutableExecutionHistory.Execution 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 of the this object
    • withScenarioId

      public final ImmutableExecutionHistory.Execution 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 of the this object
    • equals

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

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

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

      Creates a builder for Execution.
       ImmutableExecutionHistory.Execution.builder()
          .time(java.time.LocalDateTime) // required time
          .duration(long) // required duration
          .status(com.chutneytesting.server.core.domain.execution.report.ServerReportStatus) // required status
          .info(String) // optional info
          .error(String) // optional error
          .testCaseTitle(String) // required testCaseTitle
          .environment(String) // required environment
          .datasetId(String) // optional datasetId
          .datasetVersion(Integer) // optional datasetVersion
          .user(String) // required user
          .campaignReport(com.chutneytesting.server.core.domain.scenario.campaign.CampaignExecution) // optional campaignReport
          .report(String) // required report
          .executionId(Long) // required executionId
          .scenarioId(String) // required scenarioId
          .build();
       
      Returns:
      A new Execution builder