Package com.spotify.github.v3.prs
Class ImmutableReviewParameters
- java.lang.Object
-
- com.spotify.github.v3.prs.ReviewParameters
-
- com.spotify.github.v3.prs.ImmutableReviewParameters
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableReviewParameters extends ReviewParameters
Immutable implementation ofReviewParameters.Use the builder to create immutable instances:
ImmutableReviewParameters.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableReviewParameters.BuilderBuilds instances of typeImmutableReviewParameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>body()**required** when using REQUEST_CHANGES or COMMENT for the event.static ImmutableReviewParameters.Builderbuilder()Creates a builder forImmutableReviewParameters.List<ReviewComment>comments()List of comments for a non-approve review.Optional<String>commitId()SHA of the commit that needs a review.static ImmutableReviewParameterscopyOf(ReviewParameters instance)Creates an immutable copy of aReviewParametersvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableReviewParametersthat have equal attribute values.Stringevent()Review action you want to perform.inthashCode()Computes a hash code from attributes:commitId,body,event,comments.StringtoString()Prints the immutable valueReviewParameterswith attribute values.ImmutableReviewParameterswithBody(String value)Copy the current immutable object by setting a present value for the optionalbodyattribute.ImmutableReviewParameterswithBody(Optional<String> optional)Copy the current immutable object by setting an optional value for thebodyattribute.ImmutableReviewParameterswithComments(ReviewComment... elements)Copy the current immutable object with elements that replace the content ofcomments.ImmutableReviewParameterswithComments(Iterable<? extends ReviewComment> elements)Copy the current immutable object with elements that replace the content ofcomments.ImmutableReviewParameterswithCommitId(String value)Copy the current immutable object by setting a present value for the optionalcommitIdattribute.ImmutableReviewParameterswithCommitId(Optional<String> optional)Copy the current immutable object by setting an optional value for thecommitIdattribute.ImmutableReviewParameterswithEvent(String value)Copy the current immutable object by setting a value for theeventattribute.
-
-
-
Method Detail
-
commitId
public Optional<String> commitId()
SHA of the commit that needs a review. If not the latest, the review may be outdated. Defaults to the most recent commit in the PR when you do not specify a value.- Specified by:
commitIdin classReviewParameters- Returns:
- the optional commitId.
-
body
public Optional<String> body()
**required** when using REQUEST_CHANGES or COMMENT for the event.- Specified by:
bodyin classReviewParameters- Returns:
- the optional body for REQUEST_CHANGES or COMMENT events.
-
event
public String event()
Review action you want to perform. Should be one of: APPROVE, REQUEST_CHANGES or COMMENT.- Specified by:
eventin classReviewParameters- Returns:
- the review action to perform.
-
comments
public List<ReviewComment> comments()
List of comments for a non-approve review.- Specified by:
commentsin classReviewParameters- Returns:
- the list of comments for the review.
-
withCommitId
public final ImmutableReviewParameters withCommitId(String value)
Copy the current immutable object by setting a present value for the optionalcommitIdattribute.- Parameters:
value- The value for commitId- Returns:
- A modified copy of
thisobject
-
withCommitId
public final ImmutableReviewParameters withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for commitId- Returns:
- A modified copy of
thisobject
-
withBody
public final ImmutableReviewParameters 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 ImmutableReviewParameters 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
-
withEvent
public final ImmutableReviewParameters withEvent(String value)
Copy the current immutable object by setting a value for theeventattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for event- Returns:
- A modified copy of the
thisobject
-
withComments
public final ImmutableReviewParameters withComments(ReviewComment... elements)
Copy the current immutable object with elements that replace the content ofcomments.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withComments
public final ImmutableReviewParameters withComments(Iterable<? extends ReviewComment> elements)
Copy the current immutable object with elements that replace the content ofcomments. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of comments elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableReviewParametersthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:commitId,body,event,comments.
-
toString
public String toString()
Prints the immutable valueReviewParameterswith attribute values.
-
copyOf
public static ImmutableReviewParameters copyOf(ReviewParameters instance)
Creates an immutable copy of aReviewParametersvalue. 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 ReviewParameters instance
-
builder
public static ImmutableReviewParameters.Builder builder()
Creates a builder forImmutableReviewParameters.ImmutableReviewParameters.builder() .commitId(String) // optionalcommitId.body(String) // optionalbody.event(String) // requiredevent.addComments|addAllComments(com.spotify.github.v3.prs.ReviewComment) //commentselements .build();- Returns:
- A new ImmutableReviewParameters builder
-
-