Class ImmutableReview

  • All Implemented Interfaces:
    Review

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableReview
    extends Object
    implements Review
    Immutable implementation of Review.

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

    • Method Detail

      • id

        @Nullable
        public Integer id()
        Id.
        Specified by:
        id in interface Review
      • user

        @Nullable
        public User user()
        User.
        Specified by:
        user in interface Review
      • state

        @Nullable
        public String state()
        State.
        Specified by:
        state in interface Review
      • htmlUrl

        @Nullable
        public URI htmlUrl()
        Html URL.
        Specified by:
        htmlUrl in interface Review
      • pullRequestUrl

        @Nullable
        public URI pullRequestUrl()
        Pull Request URL.
        Specified by:
        pullRequestUrl in interface Review
      • commitId

        @Nullable
        public String commitId()
        Commit sha the review refers to
        Specified by:
        commitId in interface Review
      • withId

        public final ImmutableReview withId​(@Nullable
                                            Integer value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withUser

        public final ImmutableReview withUser​(@Nullable
                                              User value)
        Copy the current immutable object by setting a value for the user attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for user (can be null)
        Returns:
        A modified copy of the this object
      • withBody

        public final ImmutableReview 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 ImmutableReview 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
      • withSubmittedAt

        public final ImmutableReview withSubmittedAt​(GitHubInstant value)
        Copy the current immutable object by setting a present value for the optional submittedAt attribute.
        Parameters:
        value - The value for submittedAt
        Returns:
        A modified copy of this object
      • withSubmittedAt

        public final ImmutableReview withSubmittedAt​(Optional<? extends GitHubInstant> optional)
        Copy the current immutable object by setting an optional value for the submittedAt attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for submittedAt
        Returns:
        A modified copy of this object
      • withState

        public final ImmutableReview withState​(@Nullable
                                               String value)
        Copy the current immutable object by setting a value for the state attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for state (can be null)
        Returns:
        A modified copy of the this object
      • withHtmlUrl

        public final ImmutableReview withHtmlUrl​(@Nullable
                                                 URI value)
        Copy the current immutable object by setting a value for the htmlUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for htmlUrl (can be null)
        Returns:
        A modified copy of the this object
      • withPullRequestUrl

        public final ImmutableReview withPullRequestUrl​(@Nullable
                                                        URI value)
        Copy the current immutable object by setting a value for the pullRequestUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for pullRequestUrl (can be null)
        Returns:
        A modified copy of the this object
      • withLinks

        public final ImmutableReview withLinks​(@Nullable
                                               ReviewLinks value)
        Copy the current immutable object by setting a value for the links attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for links (can be null)
        Returns:
        A modified copy of the this object
      • withCommitId

        public final ImmutableReview withCommitId​(@Nullable
                                                  String value)
        Copy the current immutable object by setting a value for the commitId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for commitId (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableReview 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: id, user, body, submittedAt, state, htmlUrl, pullRequestUrl, links, commitId.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableReview copyOf​(Review instance)
        Creates an immutable copy of a Review 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 Review instance
      • builder

        public static ImmutableReview.Builder builder()
        Creates a builder for ImmutableReview.
         ImmutableReview.builder()
            .id(Integer | null) // nullable id
            .user(com.spotify.github.v3.User | null) // nullable user
            .body(String) // optional body
            .submittedAt(com.spotify.github.GitHubInstant) // optional submittedAt
            .state(String | null) // nullable state
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .pullRequestUrl(java.net.URI | null) // nullable pullRequestUrl
            .links(com.spotify.github.v3.activity.events.ReviewLinks | null) // nullable links
            .commitId(String | null) // nullable commitId
            .build();
         
        Returns:
        A new ImmutableReview builder