Class ImmutableProgressState

java.lang.Object
com.riadalabs.jira.plugins.insight.services.progress.model.ProgressState
com.riadalabs.jira.plugins.insight.services.progress.model.ImmutableProgressState

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProgressState extends ProgressState
Immutable implementation of ProgressState.

Use the builder to create immutable instances: ImmutableProgressState.builder().

  • Method Details

    • progressId

      public ProgressId progressId()
      Specified by:
      progressId in class ProgressState
      Returns:
      The value of the progressId attribute
    • started

      public Instant started()
      Specified by:
      started in class ProgressState
      Returns:
      The value of the started attribute
    • ended

      public Optional<Instant> ended()
      Specified by:
      ended in class ProgressState
      Returns:
      The value of the ended attribute
    • result

      public Result result()
      Specified by:
      result in class ProgressState
      Returns:
      The value of the result attribute
    • withProgressId

      public final ImmutableProgressState withProgressId(ProgressId value)
      Copy the current immutable object by setting a value for the progressId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for progressId
      Returns:
      A modified copy of the this object
    • withStarted

      public final ImmutableProgressState withStarted(Instant value)
      Copy the current immutable object by setting a value for the started attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for started
      Returns:
      A modified copy of the this object
    • withEnded

      public final ImmutableProgressState withEnded(Instant value)
      Copy the current immutable object by setting a present value for the optional ended attribute.
      Parameters:
      value - The value for ended
      Returns:
      A modified copy of this object
    • withEnded

      public final ImmutableProgressState withEnded(Optional<? extends Instant> optional)
      Copy the current immutable object by setting an optional value for the ended 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 ended
      Returns:
      A modified copy of this object
    • withResult

      public final ImmutableProgressState withResult(Result value)
      Copy the current immutable object by setting a value for the result attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for result
      Returns:
      A modified copy of the this object
    • equals

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

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

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

      public static ImmutableProgressState.Builder builder()
      Creates a builder for ImmutableProgressState.
       ImmutableProgressState.builder()
          .progressId(com.riadalabs.jira.plugins.insight.services.progress.model.ProgressId) // required progressId
          .started(java.time.Instant) // required started
          .ended(java.time.Instant) // optional ended
          .result(com.riadalabs.jira.plugins.insight.services.progress.model.Result) // required result
          .build();
       
      Returns:
      A new ImmutableProgressState builder