Class ImmutableExecutionHistory.DetachedExecution

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

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

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

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

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

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

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

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

      Creates a builder for DetachedExecution.
       ImmutableExecutionHistory.DetachedExecution.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
          .report(String) // required report
          .build();
       
      Returns:
      A new DetachedExecution builder