Package com.spotify.github.v3.prs
Class ImmutableReviewComment
- java.lang.Object
-
- com.spotify.github.v3.prs.ReviewComment
-
- com.spotify.github.v3.prs.ImmutableReviewComment
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableReviewComment extends ReviewComment
Immutable implementation ofReviewComment
.Use the builder to create immutable instances:
ImmutableReviewComment.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableReviewComment.Builder
Builds instances of typeImmutableReviewComment
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
body()
Text of the review comment.static ImmutableReviewComment.Builder
builder()
Creates a builder forImmutableReviewComment
.static ImmutableReviewComment
copyOf(ReviewComment instance)
Creates an immutable copy of aReviewComment
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableReviewComment
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:path
,position
,body
.String
path()
Relative path to the file that necessitates a review comment.int
position()
Position in the diff where you want to add a review comment.String
toString()
Prints the immutable valueReviewComment
with attribute values.ImmutableReviewComment
withBody(String value)
Copy the current immutable object by setting a value for thebody
attribute.ImmutableReviewComment
withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute.ImmutableReviewComment
withPosition(int value)
Copy the current immutable object by setting a value for theposition
attribute.
-
-
-
Method Detail
-
path
public String path()
Relative path to the file that necessitates a review comment.- Specified by:
path
in classReviewComment
- Returns:
- the path to the file.
-
position
public int position()
Position in the diff where you want to add a review comment.- Specified by:
position
in classReviewComment
- Returns:
- the position in the diff.
-
body
public String body()
Text of the review comment.- Specified by:
body
in classReviewComment
- Returns:
- the text of the review.
-
withPath
public final ImmutableReviewComment withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for path- Returns:
- A modified copy of the
this
object
-
withPosition
public final ImmutableReviewComment withPosition(int value)
Copy the current immutable object by setting a value for theposition
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for position- Returns:
- A modified copy of the
this
object
-
withBody
public final ImmutableReviewComment withBody(String value)
Copy the current immutable object by setting a value for thebody
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for body- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableReviewComment
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:path
,position
,body
.
-
toString
public String toString()
Prints the immutable valueReviewComment
with attribute values.
-
copyOf
public static ImmutableReviewComment copyOf(ReviewComment instance)
Creates an immutable copy of aReviewComment
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 ReviewComment instance
-
builder
public static ImmutableReviewComment.Builder builder()
Creates a builder forImmutableReviewComment
.ImmutableReviewComment.builder() .path(String) // required
path
.position(int) // requiredposition
.body(String) // requiredbody
.build();- Returns:
- A new ImmutableReviewComment builder
-
-