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 class
ImmutablePullRequestCreate.Builder
Builds instances of typeImmutablePullRequestCreate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
base()
The name of the branch you want your changes pulled into.Optional<String>
body()
The contents of the pull request.static ImmutablePullRequestCreate.Builder
builder()
Creates a builder forImmutablePullRequestCreate
.static ImmutablePullRequestCreate
copyOf(PullRequestCreate instance)
Creates an immutable copy of aPullRequestCreate
value.Boolean
draft()
Indicates whether the pull request is a draft.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePullRequestCreate
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:title
,body
,head
,base
,draft
.String
head()
The name of the branch where your changes are implemented.String
title()
The title of the pull request.String
toString()
Prints the immutable valuePullRequestCreate
with attribute values.ImmutablePullRequestCreate
withBase(String value)
Copy the current immutable object by setting a value for thebase
attribute.ImmutablePullRequestCreate
withBody(String value)
Copy the current immutable object by setting a present value for the optionalbody
attribute.ImmutablePullRequestCreate
withBody(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebody
attribute.ImmutablePullRequestCreate
withDraft(Boolean value)
Copy the current immutable object by setting a value for thedraft
attribute.ImmutablePullRequestCreate
withHead(String value)
Copy the current immutable object by setting a value for thehead
attribute.ImmutablePullRequestCreate
withTitle(String value)
Copy the current immutable object by setting a value for thetitle
attribute.
-
-
-
Method Detail
-
title
@Nullable public String title()
The title of the pull request.- Specified by:
title
in interfacePullRequestCreate
-
body
public Optional<String> body()
The contents of the pull request.- Specified by:
body
in 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:
head
in 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:
base
in interfacePullRequestCreate
-
draft
@Nullable public Boolean draft()
Indicates whether the pull request is a draft.- Specified by:
draft
in interfacePullRequestCreate
-
withTitle
public final ImmutablePullRequestCreate withTitle(@Nullable String value)
Copy the current immutable object by setting a value for thetitle
attribute. 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
this
object
-
withBody
public final ImmutablePullRequestCreate withBody(String value)
Copy the current immutable object by setting a present value for the optionalbody
attribute.- Parameters:
value
- The value for body- Returns:
- A modified copy of
this
object
-
withBody
public final ImmutablePullRequestCreate withBody(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebody
attribute. 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
this
object
-
withHead
public final ImmutablePullRequestCreate withHead(@Nullable String value)
Copy the current immutable object by setting a value for thehead
attribute. 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
this
object
-
withBase
public final ImmutablePullRequestCreate withBase(@Nullable String value)
Copy the current immutable object by setting a value for thebase
attribute. 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
this
object
-
withDraft
public final ImmutablePullRequestCreate withDraft(@Nullable Boolean value)
Copy the current immutable object by setting a value for thedraft
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePullRequestCreate
that 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 valuePullRequestCreate
with attribute values.
-
copyOf
public static ImmutablePullRequestCreate copyOf(PullRequestCreate instance)
Creates an immutable copy of aPullRequestCreate
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 PullRequestCreate instance
-
builder
public static ImmutablePullRequestCreate.Builder builder()
Creates a builder forImmutablePullRequestCreate
.ImmutablePullRequestCreate.builder() .title(String | null) // nullable
title
.body(String) // optionalbody
.head(String | null) // nullablehead
.base(String | null) // nullablebase
.draft(Boolean | null) // nullabledraft
.build();- Returns:
- A new ImmutablePullRequestCreate builder
-
-