Class ImmutableStatus

  • All Implemented Interfaces:
    UpdateTracking, Status

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

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

    • Method Detail

      • state

        @Nullable
        public String state()
        The state of the status. Can be one of pending, success, error, or failure.
        Specified by:
        state in interface Status
      • targetUrl

        public Optional<URI> targetUrl()
        The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the 'source' of the Status.
        Specified by:
        targetUrl in interface Status
      • id

        @Nullable
        public Long id()
        Status id
        Specified by:
        id in interface Status
      • url

        @Nullable
        public URI url()
        Status URL
        Specified by:
        url in interface Status
      • context

        public Optional<String> context()
        A string label to differentiate this status from the status of other systems. Default: "default"
        Specified by:
        context in interface Status
      • withCreatedAt

        public final ImmutableStatus 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 ImmutableStatus 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
      • withState

        public final ImmutableStatus 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
      • withTargetUrl

        public final ImmutableStatus 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 ImmutableStatus 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
      • withDescription

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

        public final ImmutableStatus 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 ImmutableStatus 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
      • withContext

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

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

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

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

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

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

        public final ImmutableStatus 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 ImmutableStatus 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
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableStatus 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, state, targetUrl, description, id, url, context, creator, deploymentUrl, repositoryUrl.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableStatus.Builder builder()
        Creates a builder for ImmutableStatus.
         ImmutableStatus.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .state(String | null) // nullable state
            .targetUrl(java.net.URI) // optional targetUrl
            .description(String) // optional description
            .id(Long | null) // nullable id
            .url(java.net.URI | null) // nullable url
            .context(String) // optional context
            .creator(com.spotify.github.v3.User) // optional creator
            .deploymentUrl(java.net.URI) // optional deploymentUrl
            .repositoryUrl(java.net.URI) // optional repositoryUrl
            .build();
         
        Returns:
        A new ImmutableStatus builder