Package com.spotify.github.v3.prs
Class ImmutableMergeParameters.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutableMergeParameters.Builder
-
- Enclosing class:
- ImmutableMergeParameters
@NotThreadSafe public static final class ImmutableMergeParameters.Builder extends Object
Builds instances of typeImmutableMergeParameters
. Initialize attributes and then invoke thebuild()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMergeParameters
build()
Builds a newImmutableMergeParameters
.ImmutableMergeParameters.Builder
commitMessage(String commitMessage)
Initializes the optional valuecommitMessage
to commitMessage.ImmutableMergeParameters.Builder
commitMessage(Optional<String> commitMessage)
Initializes the optional valuecommitMessage
to commitMessage.ImmutableMergeParameters.Builder
commitTitle(String commitTitle)
Initializes the optional valuecommitTitle
to commitTitle.ImmutableMergeParameters.Builder
commitTitle(Optional<String> commitTitle)
Initializes the optional valuecommitTitle
to commitTitle.ImmutableMergeParameters.Builder
from(MergeParameters instance)
Fill a builder with attribute values from the providedMergeParameters
instance.ImmutableMergeParameters.Builder
mergeMethod(MergeMethod mergeMethod)
Initializes the value for themergeMethod
attribute.ImmutableMergeParameters.Builder
sha(String sha)
Initializes the value for thesha
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder from(MergeParameters instance)
Fill a builder with attribute values from the providedMergeParameters
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
-
sha
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder sha(String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha- Returns:
this
builder for use in a chained invocation
-
commitMessage
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder commitMessage(String commitMessage)
Initializes the optional valuecommitMessage
to commitMessage.- Parameters:
commitMessage
- The value for commitMessage- Returns:
this
builder for chained invocation
-
commitMessage
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder commitMessage(Optional<String> commitMessage)
Initializes the optional valuecommitMessage
to commitMessage.- Parameters:
commitMessage
- The value for commitMessage- Returns:
this
builder for use in a chained invocation
-
commitTitle
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder commitTitle(String commitTitle)
Initializes the optional valuecommitTitle
to commitTitle.- Parameters:
commitTitle
- The value for commitTitle- Returns:
this
builder for chained invocation
-
commitTitle
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder commitTitle(Optional<String> commitTitle)
Initializes the optional valuecommitTitle
to commitTitle.- Parameters:
commitTitle
- The value for commitTitle- Returns:
this
builder for use in a chained invocation
-
mergeMethod
@CanIgnoreReturnValue public final ImmutableMergeParameters.Builder mergeMethod(MergeMethod mergeMethod)
Initializes the value for themergeMethod
attribute.If not set, this attribute will have a default value as returned by the initializer of
mergeMethod
.- Parameters:
mergeMethod
- The value for mergeMethod- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableMergeParameters build()
Builds a newImmutableMergeParameters
.- Returns:
- An immutable instance of MergeParameters
- Throws:
IllegalStateException
- if any required attributes are missing
-
-