Class ImmutableProgressState.Builder
java.lang.Object
com.riadalabs.jira.plugins.insight.services.progress.model.ImmutableProgressState.Builder
- Enclosing class:
- ImmutableProgressState
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 Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableProgressState
.Initializes the optional valueended
to ended.Initializes the optional valueended
to ended.from
(ProgressState instance) Fill a builder with attribute values from the providedProgressState
instance.progressId
(ProgressId progressId) Initializes the value for theprogressId
attribute.Initializes the value for theresult
attribute.Initializes the value for thestarted
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedProgressState
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
Initializes the value for theprogressId
attribute.- Parameters:
progressId
- The value for progressId- Returns:
this
builder for use in a chained invocation
-
started
Initializes the value for thestarted
attribute.- Parameters:
started
- The value for started- Returns:
this
builder for use in a chained invocation
-
ended
Initializes the optional valueended
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 valueended
to ended.- Parameters:
ended
- The value for ended- Returns:
this
builder for use in a chained invocation
-
result
Initializes the value for theresult
attribute.- Parameters:
result
- The value for result- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableProgressState
.- Returns:
- An immutable instance of ProgressState
- Throws:
IllegalStateException
- if any required attributes are missing
-