Class ImmutableEvent

  • All Implemented Interfaces:
    Event

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

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

    • Method Detail

      • id

        @Nullable
        public Integer id()
        The Integer ID of the event.
        Specified by:
        id in interface Event
      • url

        @Nullable
        public URI url()
        The API URL for fetching the event.
        Specified by:
        url in interface Event
      • actor

        @Nullable
        public User actor()
        The User object that generated the event.
        Specified by:
        actor in interface Event
      • event

        @Nullable
        public String event()
        Identifies the actual type of Event that occurred.
        Specified by:
        event in interface Event
      • commitId

        @Nullable
        public String commitId()
        The String SHA of a commit that referenced this Issue.
        Specified by:
        commitId in interface Event
      • commitUrl

        @Nullable
        public URI commitUrl()
        The GitHub API link to a commit that referenced this Issue.
        Specified by:
        commitUrl in interface Event
      • createdAt

        @Nullable
        public GitHubInstant createdAt()
        The timestamp indicating when the event occurred.
        Specified by:
        createdAt in interface Event
      • withId

        public final ImmutableEvent 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
      • withUrl

        public final ImmutableEvent 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
      • withActor

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

        public final ImmutableEvent withEvent​(@Nullable
                                              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 (can be null)
        Returns:
        A modified copy of the this object
      • withCommitId

        public final ImmutableEvent 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
      • withCommitUrl

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

        public final ImmutableEvent 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
      • withIssue

        public final ImmutableEvent withIssue​(Issue value)
        Copy the current immutable object by setting a present value for the optional issue attribute.
        Parameters:
        value - The value for issue
        Returns:
        A modified copy of this object
      • withIssue

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

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableEvent 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, url, actor, event, commitId, commitUrl, createdAt, issue.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableEvent.Builder builder()
        Creates a builder for ImmutableEvent.
         ImmutableEvent.builder()
            .id(Integer | null) // nullable id
            .url(java.net.URI | null) // nullable url
            .actor(com.spotify.github.v3.User | null) // nullable actor
            .event(String | null) // nullable event
            .commitId(String | null) // nullable commitId
            .commitUrl(java.net.URI | null) // nullable commitUrl
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .issue(com.spotify.github.v3.issues.Issue) // optional issue
            .build();
         
        Returns:
        A new ImmutableEvent builder