Class ImmutablePullRequestUpdate
- java.lang.Object
-
- com.spotify.github.v3.prs.requests.ImmutablePullRequestUpdate
-
- All Implemented Interfaces:
PullRequestUpdate
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePullRequestUpdate extends Object implements PullRequestUpdate
Immutable implementation ofPullRequestUpdate
.Use the builder to create immutable instances:
ImmutablePullRequestUpdate.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutablePullRequestUpdate.Builder
Builds instances of typeImmutablePullRequestUpdate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
body()
The contents of the pull request.static ImmutablePullRequestUpdate.Builder
builder()
Creates a builder forImmutablePullRequestUpdate
.static ImmutablePullRequestUpdate
copyOf(PullRequestUpdate instance)
Creates an immutable copy of aPullRequestUpdate
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePullRequestUpdate
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:title
,body
,state
.Optional<String>
state()
State of this Pull Request.Optional<String>
title()
The title of the pull request.String
toString()
Prints the immutable valuePullRequestUpdate
with attribute values.ImmutablePullRequestUpdate
withBody(String value)
Copy the current immutable object by setting a present value for the optionalbody
attribute.ImmutablePullRequestUpdate
withBody(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebody
attribute.ImmutablePullRequestUpdate
withState(String value)
Copy the current immutable object by setting a present value for the optionalstate
attribute.ImmutablePullRequestUpdate
withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestate
attribute.ImmutablePullRequestUpdate
withTitle(String value)
Copy the current immutable object by setting a present value for the optionaltitle
attribute.ImmutablePullRequestUpdate
withTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetitle
attribute.
-
-
-
Method Detail
-
title
public Optional<String> title()
The title of the pull request.- Specified by:
title
in interfacePullRequestUpdate
-
body
public Optional<String> body()
The contents of the pull request.- Specified by:
body
in interfacePullRequestUpdate
-
state
public Optional<String> state()
State of this Pull Request. Either open or closed.- Specified by:
state
in interfacePullRequestUpdate
-
withTitle
public final ImmutablePullRequestUpdate withTitle(String value)
Copy the current immutable object by setting a present value for the optionaltitle
attribute.- Parameters:
value
- The value for title- Returns:
- A modified copy of
this
object
-
withTitle
public final ImmutablePullRequestUpdate withTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetitle
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for title- Returns:
- A modified copy of
this
object
-
withBody
public final ImmutablePullRequestUpdate 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 ImmutablePullRequestUpdate 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
-
withState
public final ImmutablePullRequestUpdate withState(String value)
Copy the current immutable object by setting a present value for the optionalstate
attribute.- Parameters:
value
- The value for state- Returns:
- A modified copy of
this
object
-
withState
public final ImmutablePullRequestUpdate withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestate
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for state- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePullRequestUpdate
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:title
,body
,state
.
-
toString
public String toString()
Prints the immutable valuePullRequestUpdate
with attribute values.
-
copyOf
public static ImmutablePullRequestUpdate copyOf(PullRequestUpdate instance)
Creates an immutable copy of aPullRequestUpdate
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 PullRequestUpdate instance
-
builder
public static ImmutablePullRequestUpdate.Builder builder()
Creates a builder forImmutablePullRequestUpdate
.ImmutablePullRequestUpdate.builder() .title(String) // optional
title
.body(String) // optionalbody
.state(String) // optionalstate
.build();- Returns:
- A new ImmutablePullRequestUpdate builder
-
-