Class ImmutablePullRequestCreate
- java.lang.Object
-
- com.spotify.github.v3.prs.requests.ImmutablePullRequestCreate
-
- All Implemented Interfaces:
PullRequestCreate
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePullRequestCreate extends Object implements PullRequestCreate
Immutable implementation ofPullRequestCreate.Use the builder to create immutable instances:
ImmutablePullRequestCreate.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePullRequestCreate.BuilderBuilds instances of typeImmutablePullRequestCreate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbase()The name of the branch you want your changes pulled into.Optional<String>body()The contents of the pull request.static ImmutablePullRequestCreate.Builderbuilder()Creates a builder forImmutablePullRequestCreate.static ImmutablePullRequestCreatecopyOf(PullRequestCreate instance)Creates an immutable copy of aPullRequestCreatevalue.Booleandraft()Indicates whether the pull request is a draft.booleanequals(Object another)This instance is equal to all instances ofImmutablePullRequestCreatethat have equal attribute values.inthashCode()Computes a hash code from attributes:title,body,head,base,draft.Stringhead()The name of the branch where your changes are implemented.Stringtitle()The title of the pull request.StringtoString()Prints the immutable valuePullRequestCreatewith attribute values.ImmutablePullRequestCreatewithBase(String value)Copy the current immutable object by setting a value for thebaseattribute.ImmutablePullRequestCreatewithBody(String value)Copy the current immutable object by setting a present value for the optionalbodyattribute.ImmutablePullRequestCreatewithBody(Optional<String> optional)Copy the current immutable object by setting an optional value for thebodyattribute.ImmutablePullRequestCreatewithDraft(Boolean value)Copy the current immutable object by setting a value for thedraftattribute.ImmutablePullRequestCreatewithHead(String value)Copy the current immutable object by setting a value for theheadattribute.ImmutablePullRequestCreatewithTitle(String value)Copy the current immutable object by setting a value for thetitleattribute.
-
-
-
Method Detail
-
title
@Nullable public String title()
The title of the pull request.- Specified by:
titlein interfacePullRequestCreate
-
body
public Optional<String> body()
The contents of the pull request.- Specified by:
bodyin interfacePullRequestCreate
-
head
@Nullable public String head()
The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.- Specified by:
headin interfacePullRequestCreate
-
base
@Nullable public String base()
The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.- Specified by:
basein interfacePullRequestCreate
-
draft
@Nullable public Boolean draft()
Indicates whether the pull request is a draft.- Specified by:
draftin interfacePullRequestCreate
-
withTitle
public final ImmutablePullRequestCreate withTitle(@Nullable String value)
Copy the current immutable object by setting a value for thetitleattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for title (can benull)- Returns:
- A modified copy of the
thisobject
-
withBody
public final ImmutablePullRequestCreate withBody(String value)
Copy the current immutable object by setting a present value for the optionalbodyattribute.- Parameters:
value- The value for body- Returns:
- A modified copy of
thisobject
-
withBody
public final ImmutablePullRequestCreate withBody(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebodyattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for body- Returns:
- A modified copy of
thisobject
-
withHead
public final ImmutablePullRequestCreate withHead(@Nullable String value)
Copy the current immutable object by setting a value for theheadattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for head (can benull)- Returns:
- A modified copy of the
thisobject
-
withBase
public final ImmutablePullRequestCreate withBase(@Nullable String value)
Copy the current immutable object by setting a value for thebaseattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for base (can benull)- Returns:
- A modified copy of the
thisobject
-
withDraft
public final ImmutablePullRequestCreate withDraft(@Nullable Boolean value)
Copy the current immutable object by setting a value for thedraftattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for draft (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePullRequestCreatethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:title,body,head,base,draft.
-
toString
public String toString()
Prints the immutable valuePullRequestCreatewith attribute values.
-
copyOf
public static ImmutablePullRequestCreate copyOf(PullRequestCreate instance)
Creates an immutable copy of aPullRequestCreatevalue. 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 PullRequestCreate instance
-
builder
public static ImmutablePullRequestCreate.Builder builder()
Creates a builder forImmutablePullRequestCreate.ImmutablePullRequestCreate.builder() .title(String | null) // nullabletitle.body(String) // optionalbody.head(String | null) // nullablehead.base(String | null) // nullablebase.draft(Boolean | null) // nullabledraft.build();- Returns:
- A new ImmutablePullRequestCreate builder
-
-