Package com.spotify.github.v3.prs
Class ImmutableMergeParameters
- java.lang.Object
-
- com.spotify.github.v3.prs.MergeParameters
-
- com.spotify.github.v3.prs.ImmutableMergeParameters
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMergeParameters extends MergeParameters
Immutable implementation ofMergeParameters
.Use the builder to create immutable instances:
ImmutableMergeParameters.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableMergeParameters.Builder
Builds instances of typeImmutableMergeParameters
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMergeParameters.Builder
builder()
Creates a builder forImmutableMergeParameters
.Optional<String>
commitMessage()
Extra detail to append to automatic commit message.Optional<String>
commitTitle()
Title for the automatic commit message.static ImmutableMergeParameters
copyOf(MergeParameters instance)
Creates an immutable copy of aMergeParameters
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableMergeParameters
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,commitMessage
,commitTitle
,mergeMethod
.MergeMethod
mergeMethod()
Merge method to use.String
sha()
SHA that pull request head must match to allow merge.String
toString()
Prints the immutable valueMergeParameters
with attribute values.ImmutableMergeParameters
withCommitMessage(String value)
Copy the current immutable object by setting a present value for the optionalcommitMessage
attribute.ImmutableMergeParameters
withCommitMessage(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitMessage
attribute.ImmutableMergeParameters
withCommitTitle(String value)
Copy the current immutable object by setting a present value for the optionalcommitTitle
attribute.ImmutableMergeParameters
withCommitTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitTitle
attribute.ImmutableMergeParameters
withMergeMethod(MergeMethod value)
Copy the current immutable object by setting a value for themergeMethod
attribute.ImmutableMergeParameters
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.
-
-
-
Method Detail
-
sha
public String sha()
SHA that pull request head must match to allow merge.- Specified by:
sha
in classMergeParameters
- Returns:
- the string
-
commitMessage
public Optional<String> commitMessage()
Extra detail to append to automatic commit message.- Specified by:
commitMessage
in classMergeParameters
- Returns:
- the optional
-
commitTitle
public Optional<String> commitTitle()
Title for the automatic commit message.- Specified by:
commitTitle
in classMergeParameters
- Returns:
- the optional commit title
-
mergeMethod
public MergeMethod mergeMethod()
Merge method to use.- Overrides:
mergeMethod
in classMergeParameters
- Returns:
- the merge method enum value
-
withSha
public final ImmutableMergeParameters withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for sha- Returns:
- A modified copy of the
this
object
-
withCommitMessage
public final ImmutableMergeParameters withCommitMessage(String value)
Copy the current immutable object by setting a present value for the optionalcommitMessage
attribute.- Parameters:
value
- The value for commitMessage- Returns:
- A modified copy of
this
object
-
withCommitMessage
public final ImmutableMergeParameters withCommitMessage(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitMessage
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for commitMessage- Returns:
- A modified copy of
this
object
-
withCommitTitle
public final ImmutableMergeParameters withCommitTitle(String value)
Copy the current immutable object by setting a present value for the optionalcommitTitle
attribute.- Parameters:
value
- The value for commitTitle- Returns:
- A modified copy of
this
object
-
withCommitTitle
public final ImmutableMergeParameters withCommitTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitTitle
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for commitTitle- Returns:
- A modified copy of
this
object
-
withMergeMethod
public final ImmutableMergeParameters withMergeMethod(MergeMethod value)
Copy the current immutable object by setting a value for themergeMethod
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mergeMethod- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableMergeParameters
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha
,commitMessage
,commitTitle
,mergeMethod
.
-
toString
public String toString()
Prints the immutable valueMergeParameters
with attribute values.
-
copyOf
public static ImmutableMergeParameters copyOf(MergeParameters instance)
Creates an immutable copy of aMergeParameters
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 MergeParameters instance
-
builder
public static ImmutableMergeParameters.Builder builder()
Creates a builder forImmutableMergeParameters
.ImmutableMergeParameters.builder() .sha(String) // required
sha
.commitMessage(String) // optionalcommitMessage
.commitTitle(String) // optionalcommitTitle
.mergeMethod(com.spotify.github.v3.prs.MergeMethod) // optionalmergeMethod
.build();- Returns:
- A new ImmutableMergeParameters builder
-
-