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 classImmutableReviewComment.BuilderBuilds instances of typeImmutableReviewComment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbody()Text of the review comment.static ImmutableReviewComment.Builderbuilder()Creates a builder forImmutableReviewComment.static ImmutableReviewCommentcopyOf(ReviewComment instance)Creates an immutable copy of aReviewCommentvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableReviewCommentthat have equal attribute values.inthashCode()Computes a hash code from attributes:path,position,body.Stringpath()Relative path to the file that necessitates a review comment.intposition()Position in the diff where you want to add a review comment.StringtoString()Prints the immutable valueReviewCommentwith attribute values.ImmutableReviewCommentwithBody(String value)Copy the current immutable object by setting a value for thebodyattribute.ImmutableReviewCommentwithPath(String value)Copy the current immutable object by setting a value for thepathattribute.ImmutableReviewCommentwithPosition(int value)Copy the current immutable object by setting a value for thepositionattribute.
-
-
-
Method Detail
-
path
public String path()
Relative path to the file that necessitates a review comment.- Specified by:
pathin 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:
positionin classReviewComment- Returns:
- the position in the diff.
-
body
public String body()
Text of the review comment.- Specified by:
bodyin classReviewComment- Returns:
- the text of the review.
-
withPath
public final ImmutableReviewComment withPath(String value)
Copy the current immutable object by setting a value for thepathattribute. 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
thisobject
-
withPosition
public final ImmutableReviewComment withPosition(int value)
Copy the current immutable object by setting a value for thepositionattribute. 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
thisobject
-
withBody
public final ImmutableReviewComment withBody(String value)
Copy the current immutable object by setting a value for thebodyattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableReviewCommentthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:path,position,body.
-
toString
public String toString()
Prints the immutable valueReviewCommentwith attribute values.
-
copyOf
public static ImmutableReviewComment copyOf(ReviewComment instance)
Creates an immutable copy of aReviewCommentvalue. 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) // requiredpath.position(int) // requiredposition.body(String) // requiredbody.build();- Returns:
- A new ImmutableReviewComment builder
-
-