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 class
ImmutableReviewParameters.Builder
Builds 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.Builder
builder()
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 ImmutableReviewParameters
copyOf(ReviewParameters instance)
Creates an immutable copy of aReviewParameters
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableReviewParameters
that have equal attribute values.String
event()
Review action you want to perform.int
hashCode()
Computes a hash code from attributes:commitId
,body
,event
,comments
.String
toString()
Prints the immutable valueReviewParameters
with attribute values.ImmutableReviewParameters
withBody(String value)
Copy the current immutable object by setting a present value for the optionalbody
attribute.ImmutableReviewParameters
withBody(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebody
attribute.ImmutableReviewParameters
withComments(ReviewComment... elements)
Copy the current immutable object with elements that replace the content ofcomments
.ImmutableReviewParameters
withComments(Iterable<? extends ReviewComment> elements)
Copy the current immutable object with elements that replace the content ofcomments
.ImmutableReviewParameters
withCommitId(String value)
Copy the current immutable object by setting a present value for the optionalcommitId
attribute.ImmutableReviewParameters
withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitId
attribute.ImmutableReviewParameters
withEvent(String value)
Copy the current immutable object by setting a value for theevent
attribute.
-
-
-
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:
commitId
in classReviewParameters
- Returns:
- the optional commitId.
-
body
public Optional<String> body()
**required** when using REQUEST_CHANGES or COMMENT for the event.- Specified by:
body
in 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:
event
in classReviewParameters
- Returns:
- the review action to perform.
-
comments
public List<ReviewComment> comments()
List of comments for a non-approve review.- Specified by:
comments
in 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 optionalcommitId
attribute.- Parameters:
value
- The value for commitId- Returns:
- A modified copy of
this
object
-
withCommitId
public final ImmutableReviewParameters withCommitId(Optional<String> optional)
Copy the current immutable object by setting an optional value for thecommitId
attribute. 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
this
object
-
withBody
public final ImmutableReviewParameters 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 ImmutableReviewParameters 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
-
withEvent
public final ImmutableReviewParameters withEvent(String value)
Copy the current immutable object by setting a value for theevent
attribute. 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
this
object
-
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
this
object
-
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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableReviewParameters
that 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 valueReviewParameters
with attribute values.
-
copyOf
public static ImmutableReviewParameters copyOf(ReviewParameters instance)
Creates an immutable copy of aReviewParameters
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 ReviewParameters instance
-
builder
public static ImmutableReviewParameters.Builder builder()
Creates a builder forImmutableReviewParameters
.ImmutableReviewParameters.builder() .commitId(String) // optional
commitId
.body(String) // optionalbody
.event(String) // requiredevent
.addComments|addAllComments(com.spotify.github.v3.prs.ReviewComment) //comments
elements .build();- Returns:
- A new ImmutableReviewParameters builder
-
-