Class ImmutablePullRequestEvent

  • All Implemented Interfaces:
    BaseEvent, PullRequestEvent

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

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

    • Method Detail

      • sender

        @Nullable
        public User sender()
        The User that triggered/sent the event.
        Specified by:
        sender in interface BaseEvent
      • action

        @Nullable
        public String action()
        The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", or "reopened", or "synchronize". If the action is "closed" and the merged key is false, the pull request was closed with unmerged commits. If the action is "closed" and the merged key is true, the pull request was merged.
        Specified by:
        action in interface PullRequestEvent
      • withRepository

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

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

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

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

        public final ImmutablePullRequestEvent 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
      • withPullRequest

        public final ImmutablePullRequestEvent withPullRequest​(@Nullable
                                                               PullRequest value)
        Copy the current immutable object by setting a value for the pullRequest attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for pullRequest (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 ImmutablePullRequestEvent 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: repository, sender, eventInstallation, action, number, pullRequest.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutablePullRequestEvent.Builder builder()
        Creates a builder for ImmutablePullRequestEvent.
         ImmutablePullRequestEvent.builder()
            .repository(com.spotify.github.v3.repos.Repository | null) // nullable repository
            .sender(com.spotify.github.v3.User | null) // nullable sender
            .eventInstallation(com.spotify.github.v3.activity.events.EventInstallation | null) // nullable eventInstallation
            .action(String | null) // nullable action
            .number(Integer | null) // nullable number
            .pullRequest(com.spotify.github.v3.prs.PullRequest | null) // nullable pullRequest
            .build();
         
        Returns:
        A new ImmutablePullRequestEvent builder