Class ImmutableIssue

  • All Implemented Interfaces:
    CloseTracking, UpdateTracking, Issue

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

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

    • Method Detail

      • id

        @Nullable
        public Long id()
        ID.
        Specified by:
        id in interface Issue
      • url

        @Nullable
        public URI url()
        URL.
        Specified by:
        url in interface Issue
      • labelsUrl

        @Nullable
        public String labelsUrl()
        Labels URL template.
        Specified by:
        labelsUrl in interface Issue
      • commentsUrl

        @Nullable
        public URI commentsUrl()
        Comments URL.
        Specified by:
        commentsUrl in interface Issue
      • htmlUrl

        @Nullable
        public URI htmlUrl()
        HTML URL.
        Specified by:
        htmlUrl in interface Issue
      • number

        @Nullable
        public Integer number()
        Number.
        Specified by:
        number in interface Issue
      • state

        @Nullable
        public String state()
        Indicates the state of the issues to return. Can be either open, closed, or all.
        Specified by:
        state in interface Issue
      • title

        @Nullable
        public String title()
        The title of the issue.
        Specified by:
        title in interface Issue
      • user

        @Nullable
        public User user()
        User.
        Specified by:
        user in interface Issue
      • labels

        @Nullable
        public List<Label> labels()
        A list of comma separated label names. Example: bug,ui,@highl.
        Specified by:
        labels in interface Issue
      • assignee

        public Optional<User> assignee()
        Login for the user that this issue should be assigned to.
        Specified by:
        assignee in interface Issue
      • locked

        @Nullable
        public Boolean locked()
        Is locked.
        Specified by:
        locked in interface Issue
      • comments

        @Nullable
        public Integer comments()
        Number of comments.
        Specified by:
        comments in interface Issue
      • withCreatedAt

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

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

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

        public final ImmutableIssue withClosedAt​(Optional<? extends GitHubInstant> optional)
        Copy the current immutable object by setting an optional value for the closedAt 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 closedAt
        Returns:
        A modified copy of this object
      • withId

        public final ImmutableIssue withId​(@Nullable
                                           Long 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
      • withUrl

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

        public final ImmutableIssue withEventsUrl​(URI value)
        Copy the current immutable object by setting a present value for the optional eventsUrl attribute.
        Parameters:
        value - The value for eventsUrl
        Returns:
        A modified copy of this object
      • withEventsUrl

        public final ImmutableIssue withEventsUrl​(Optional<? extends URI> optional)
        Copy the current immutable object by setting an optional value for the eventsUrl 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 eventsUrl
        Returns:
        A modified copy of this object
      • withRepositoryUrl

        public final ImmutableIssue withRepositoryUrl​(URI value)
        Copy the current immutable object by setting a present value for the optional repositoryUrl attribute.
        Parameters:
        value - The value for repositoryUrl
        Returns:
        A modified copy of this object
      • withRepositoryUrl

        public final ImmutableIssue withRepositoryUrl​(Optional<? extends URI> optional)
        Copy the current immutable object by setting an optional value for the repositoryUrl 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 repositoryUrl
        Returns:
        A modified copy of this object
      • withLabelsUrl

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

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

        public final ImmutableIssue 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
      • withNumber

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

        public final ImmutableIssue 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
      • withTitle

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

        public final ImmutableIssue 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 ImmutableIssue 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
      • withUser

        public final ImmutableIssue 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
      • withLabels

        public final ImmutableIssue withLabels​(@Nullable
                                               Label... elements)
        Copy the current immutable object with elements that replace the content of labels.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withLabels

        public final ImmutableIssue withLabels​(@Nullable
                                               Iterable<? extends Label> elements)
        Copy the current immutable object with elements that replace the content of labels. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of labels elements to set
        Returns:
        A modified copy of this object
      • withAssignee

        public final ImmutableIssue withAssignee​(User value)
        Copy the current immutable object by setting a present value for the optional assignee attribute.
        Parameters:
        value - The value for assignee
        Returns:
        A modified copy of this object
      • withAssignee

        public final ImmutableIssue withAssignee​(Optional<? extends User> optional)
        Copy the current immutable object by setting an optional value for the assignee 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 assignee
        Returns:
        A modified copy of this object
      • withMilestone

        public final ImmutableIssue withMilestone​(Milestone value)
        Copy the current immutable object by setting a present value for the optional milestone attribute.
        Parameters:
        value - The value for milestone
        Returns:
        A modified copy of this object
      • withMilestone

        public final ImmutableIssue withMilestone​(Optional<? extends Milestone> optional)
        Copy the current immutable object by setting an optional value for the milestone 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 milestone
        Returns:
        A modified copy of this object
      • withLocked

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

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

        public final ImmutableIssue withPullRequest​(PullRequest value)
        Copy the current immutable object by setting a present value for the optional pullRequest attribute.
        Parameters:
        value - The value for pullRequest
        Returns:
        A modified copy of this object
      • withPullRequest

        public final ImmutableIssue withPullRequest​(Optional<? extends PullRequest> optional)
        Copy the current immutable object by setting an optional value for the pullRequest 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 pullRequest
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableIssue 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: createdAt, updatedAt, closedAt, id, url, eventsUrl, repositoryUrl, labelsUrl, commentsUrl, htmlUrl, number, state, title, body, user, labels, assignee, milestone, locked, comments, pullRequest.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableIssue.Builder builder()
        Creates a builder for ImmutableIssue.
         ImmutableIssue.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .closedAt(com.spotify.github.GitHubInstant) // optional closedAt
            .id(Long | null) // nullable id
            .url(java.net.URI | null) // nullable url
            .eventsUrl(java.net.URI) // optional eventsUrl
            .repositoryUrl(java.net.URI) // optional repositoryUrl
            .labelsUrl(String | null) // nullable labelsUrl
            .commentsUrl(java.net.URI | null) // nullable commentsUrl
            .htmlUrl(java.net.URI | null) // nullable htmlUrl
            .number(Integer | null) // nullable number
            .state(String | null) // nullable state
            .title(String | null) // nullable title
            .body(String) // optional body
            .user(com.spotify.github.v3.User | null) // nullable user
            .labels(List&lt;com.spotify.github.v3.issues.Label&gt; | null) // nullable labels
            .assignee(com.spotify.github.v3.User) // optional assignee
            .milestone(com.spotify.github.v3.Milestone) // optional milestone
            .locked(Boolean | null) // nullable locked
            .comments(Integer | null) // nullable comments
            .pullRequest(com.spotify.github.v3.issues.PullRequest) // optional pullRequest
            .build();
         
        Returns:
        A new ImmutableIssue builder