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 classImmutablePullRequestUpdate.BuilderBuilds 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.Builderbuilder()Creates a builder forImmutablePullRequestUpdate.static ImmutablePullRequestUpdatecopyOf(PullRequestUpdate instance)Creates an immutable copy of aPullRequestUpdatevalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePullRequestUpdatethat have equal attribute values.inthashCode()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.StringtoString()Prints the immutable valuePullRequestUpdatewith attribute values.ImmutablePullRequestUpdatewithBody(String value)Copy the current immutable object by setting a present value for the optionalbodyattribute.ImmutablePullRequestUpdatewithBody(Optional<String> optional)Copy the current immutable object by setting an optional value for thebodyattribute.ImmutablePullRequestUpdatewithState(String value)Copy the current immutable object by setting a present value for the optionalstateattribute.ImmutablePullRequestUpdatewithState(Optional<String> optional)Copy the current immutable object by setting an optional value for thestateattribute.ImmutablePullRequestUpdatewithTitle(String value)Copy the current immutable object by setting a present value for the optionaltitleattribute.ImmutablePullRequestUpdatewithTitle(Optional<String> optional)Copy the current immutable object by setting an optional value for thetitleattribute.
-
-
-
Method Detail
-
title
public Optional<String> title()
The title of the pull request.- Specified by:
titlein interfacePullRequestUpdate
-
body
public Optional<String> body()
The contents of the pull request.- Specified by:
bodyin interfacePullRequestUpdate
-
state
public Optional<String> state()
State of this Pull Request. Either open or closed.- Specified by:
statein interfacePullRequestUpdate
-
withTitle
public final ImmutablePullRequestUpdate withTitle(String value)
Copy the current immutable object by setting a present value for the optionaltitleattribute.- Parameters:
value- The value for title- Returns:
- A modified copy of
thisobject
-
withTitle
public final ImmutablePullRequestUpdate withTitle(Optional<String> optional)
Copy the current immutable object by setting an optional value for thetitleattribute. 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
thisobject
-
withBody
public final ImmutablePullRequestUpdate 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 ImmutablePullRequestUpdate 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
-
withState
public final ImmutablePullRequestUpdate withState(String value)
Copy the current immutable object by setting a present value for the optionalstateattribute.- Parameters:
value- The value for state- Returns:
- A modified copy of
thisobject
-
withState
public final ImmutablePullRequestUpdate withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestateattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePullRequestUpdatethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:title,body,state.
-
toString
public String toString()
Prints the immutable valuePullRequestUpdatewith attribute values.
-
copyOf
public static ImmutablePullRequestUpdate copyOf(PullRequestUpdate instance)
Creates an immutable copy of aPullRequestUpdatevalue. 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) // optionaltitle.body(String) // optionalbody.state(String) // optionalstate.build();- Returns:
- A new ImmutablePullRequestUpdate builder
-
-