Class ImmutableProgressState.Builder

java.lang.Object
com.riadalabs.jira.plugins.insight.services.progress.model.ImmutableProgressState.Builder
Enclosing class:
ImmutableProgressState

@NotThreadSafe public static final class ImmutableProgressState.Builder extends Object
Builds instances of type ImmutableProgressState. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder from(ProgressState instance)
      Fill a builder with attribute values from the provided ProgressState instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • progressId

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder progressId(ProgressId progressId)
      Initializes the value for the progressId attribute.
      Parameters:
      progressId - The value for progressId
      Returns:
      this builder for use in a chained invocation
    • started

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder started(Instant started)
      Initializes the value for the started attribute.
      Parameters:
      started - The value for started
      Returns:
      this builder for use in a chained invocation
    • ended

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder ended(Instant ended)
      Initializes the optional value ended to ended.
      Parameters:
      ended - The value for ended
      Returns:
      this builder for chained invocation
    • ended

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder ended(Optional<? extends Instant> ended)
      Initializes the optional value ended to ended.
      Parameters:
      ended - The value for ended
      Returns:
      this builder for use in a chained invocation
    • result

      @CanIgnoreReturnValue public final ImmutableProgressState.Builder result(Result result)
      Initializes the value for the result attribute.
      Parameters:
      result - The value for result
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableProgressState build()
      Returns:
      An immutable instance of ProgressState
      Throws:
      IllegalStateException - if any required attributes are missing