Class ImmutableReviewComment


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableReviewComment
    extends ReviewComment
    Immutable implementation of ReviewComment.

    Use the builder to create immutable instances: ImmutableReviewComment.builder().

    • Method Detail

      • path

        public String path()
        Relative path to the file that necessitates a review comment.
        Specified by:
        path in class ReviewComment
        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 class ReviewComment
        Returns:
        the position in the diff.
      • body

        public String body()
        Text of the review comment.
        Specified by:
        body in class ReviewComment
        Returns:
        the text of the review.
      • withPath

        public final ImmutableReviewComment withPath​(String value)
        Copy the current immutable object by setting a value for the path attribute. An equals check used to prevent copying of the same value by returning this.
        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 the position attribute. A value equality check is used to prevent copying of the same value by returning this.
        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 the body attribute. An equals check used to prevent copying of the same value by returning this.
        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 of ImmutableReviewComment that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: path, position, body.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value ReviewComment with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableReviewComment copyOf​(ReviewComment instance)
        Creates an immutable copy of a ReviewComment 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