Class ImmutableReviewParameters


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

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

    • 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 class ReviewParameters
        Returns:
        the optional commitId.
      • body

        public Optional<String> body()
        **required** when using REQUEST_CHANGES or COMMENT for the event.
        Specified by:
        body in class ReviewParameters
        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 class ReviewParameters
        Returns:
        the review action to perform.
      • withCommitId

        public final ImmutableReviewParameters withCommitId​(String value)
        Copy the current immutable object by setting a present value for the optional commitId 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 the commitId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        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 optional body 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 the body attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        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 the event attribute. An equals check used to prevent copying of the same value by returning this.
        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 of comments.
        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 of comments. A shallow reference equality check is used to prevent copying of the same value by returning this.
        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 of ImmutableReviewParameters 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: commitId, body, event, comments.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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