Class ImmutableStatusEvent

  • All Implemented Interfaces:
    UpdateTracking, BaseEvent, StatusEvent

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

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

    • Method Detail

      • sender

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

        @Nullable
        public Long id()
        Status event id
        Specified by:
        id in interface StatusEvent
      • name

        @Nullable
        public String name()
        Full repository name. E.g. organization/repo-name
        Specified by:
        name in interface StatusEvent
      • context

        @Nullable
        public String context()
        A string label to differentiate this status from the status of other systems. Example: continuous-integration/jenkins Default: "default"
        Specified by:
        context in interface StatusEvent
      • state

        @Nullable
        public String state()
        The new state. Can be pending, success, failure, or error.
        Specified by:
        state in interface StatusEvent
      • branches

        @Nullable
        public List<Branch> branches()
        An array of branch objects containing the status' SHA. Each branch contains the given SHA, but the SHA may or may not be the head of the branch. The array includes a maximum of 10 branches.
        Specified by:
        branches in interface StatusEvent
      • withRepository

        public final ImmutableStatusEvent 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 ImmutableStatusEvent 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 ImmutableStatusEvent 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
      • withCreatedAt

        public final ImmutableStatusEvent 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 ImmutableStatusEvent 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
      • withId

        public final ImmutableStatusEvent 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
      • withSha

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

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

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

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

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

        public final ImmutableStatusEvent withDescription​(String value)
        Copy the current immutable object by setting a present value for the optional description attribute.
        Parameters:
        value - The value for description
        Returns:
        A modified copy of this object
      • withDescription

        public final ImmutableStatusEvent withDescription​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the description 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 description
        Returns:
        A modified copy of this object
      • withState

        public final ImmutableStatusEvent 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
      • withCommit

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

        public final ImmutableStatusEvent withBranches​(@Nullable
                                                       Branch... elements)
        Copy the current immutable object with elements that replace the content of branches.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withBranches

        public final ImmutableStatusEvent withBranches​(@Nullable
                                                       Iterable<? extends Branch> elements)
        Copy the current immutable object with elements that replace the content of branches. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of branches 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 ImmutableStatusEvent 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, createdAt, updatedAt, id, sha, name, targetUrl, context, description, state, commit, branches.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableStatusEvent.Builder builder()
        Creates a builder for ImmutableStatusEvent.
         ImmutableStatusEvent.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
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .id(Long | null) // nullable id
            .sha(String | null) // nullable sha
            .name(String | null) // nullable name
            .targetUrl(java.net.URI) // optional targetUrl
            .context(String | null) // nullable context
            .description(String) // optional description
            .state(String | null) // nullable state
            .commit(com.spotify.github.v3.repos.CommitItem | null) // nullable commit
            .branches(List&lt;com.spotify.github.v3.repos.Branch&gt; | null) // nullable branches
            .build();
         
        Returns:
        A new ImmutableStatusEvent builder