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 classImmutableMergeParameters.BuilderBuilds instances of typeImmutableMergeParameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMergeParameters.Builderbuilder()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 ImmutableMergeParameterscopyOf(MergeParameters instance)Creates an immutable copy of aMergeParametersvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMergeParametersthat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,commitMessage,commitTitle,mergeMethod.MergeMethodmergeMethod()Merge method to use.Stringsha()SHA that pull request head must match to allow merge.StringtoString()Prints the immutable valueMergeParameterswith attribute values.ImmutableMergeParameterswithCommitMessage(String value)Copy the current immutable object by setting a present value for the optionalcommitMessageattribute.ImmutableMergeParameterswithCommitMessage(Optional<String> optional)Copy the current immutable object by setting an optional value for thecommitMessageattribute.ImmutableMergeParameterswithCommitTitle(String value)Copy the current immutable object by setting a present value for the optionalcommitTitleattribute.ImmutableMergeParameterswithCommitTitle(Optional<String> optional)Copy the current immutable object by setting an optional value for thecommitTitleattribute.ImmutableMergeParameterswithMergeMethod(MergeMethod value)Copy the current immutable object by setting a value for themergeMethodattribute.ImmutableMergeParameterswithSha(String value)Copy the current immutable object by setting a value for theshaattribute.
-
-
-
Method Detail
-
sha
public String sha()
SHA that pull request head must match to allow merge.- Specified by:
shain classMergeParameters- Returns:
- the string
-
commitMessage
public Optional<String> commitMessage()
Extra detail to append to automatic commit message.- Specified by:
commitMessagein classMergeParameters- Returns:
- the optional
-
commitTitle
public Optional<String> commitTitle()
Title for the automatic commit message.- Specified by:
commitTitlein classMergeParameters- Returns:
- the optional commit title
-
mergeMethod
public MergeMethod mergeMethod()
Merge method to use.- Overrides:
mergeMethodin classMergeParameters- Returns:
- the merge method enum value
-
withSha
public final ImmutableMergeParameters withSha(String value)
Copy the current immutable object by setting a value for theshaattribute. 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
thisobject
-
withCommitMessage
public final ImmutableMergeParameters withCommitMessage(String value)
Copy the current immutable object by setting a present value for the optionalcommitMessageattribute.- Parameters:
value- The value for commitMessage- Returns:
- A modified copy of
thisobject
-
withCommitMessage
public final ImmutableMergeParameters withCommitMessage(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitMessageattribute. 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
thisobject
-
withCommitTitle
public final ImmutableMergeParameters withCommitTitle(String value)
Copy the current immutable object by setting a present value for the optionalcommitTitleattribute.- Parameters:
value- The value for commitTitle- Returns:
- A modified copy of
thisobject
-
withCommitTitle
public final ImmutableMergeParameters withCommitTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitTitleattribute. 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
thisobject
-
withMergeMethod
public final ImmutableMergeParameters withMergeMethod(MergeMethod value)
Copy the current immutable object by setting a value for themergeMethodattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMergeParametersthat 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 valueMergeParameterswith attribute values.
-
copyOf
public static ImmutableMergeParameters copyOf(MergeParameters instance)
Creates an immutable copy of aMergeParametersvalue. 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) // requiredsha.commitMessage(String) // optionalcommitMessage.commitTitle(String) // optionalcommitTitle.mergeMethod(com.spotify.github.v3.prs.MergeMethod) // optionalmergeMethod.build();- Returns:
- A new ImmutableMergeParameters builder
-
-