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 valueendedto ended.Initializes the optional valueendedto ended.from(ProgressState instance) Fill a builder with attribute values from the providedProgressStateinstance.progressId(ProgressId progressId) Initializes the value for theprogressIdattribute.Initializes the value for theresultattribute.Initializes the value for thestartedattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedProgressStateinstance. 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:
thisbuilder for use in a chained invocation
-
progressId
Initializes the value for theprogressIdattribute.- Parameters:
progressId- The value for progressId- Returns:
thisbuilder for use in a chained invocation
-
started
Initializes the value for thestartedattribute.- Parameters:
started- The value for started- Returns:
thisbuilder for use in a chained invocation
-
ended
Initializes the optional valueendedto ended.- Parameters:
ended- The value for ended- Returns:
thisbuilder for chained invocation
-
ended
@CanIgnoreReturnValue public final ImmutableProgressState.Builder ended(Optional<? extends Instant> ended) Initializes the optional valueendedto ended.- Parameters:
ended- The value for ended- Returns:
thisbuilder for use in a chained invocation
-
result
Initializes the value for theresultattribute.- Parameters:
result- The value for result- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableProgressState.- Returns:
- An immutable instance of ProgressState
- Throws:
IllegalStateException- if any required attributes are missing
-