Class ImmutableDeployment

  • All Implemented Interfaces:
    UpdateTracking, Deployment

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

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

    • Method Detail

      • url

        @Nullable
        public URI url()
        Deployment API URL
        Specified by:
        url in interface Deployment
      • id

        @Nullable
        public Long id()
        The Deployment ID to list the statuses from.
        Specified by:
        id in interface Deployment
      • sha

        @Nullable
        public String sha()
        The SHA that was recorded at creation time.
        Specified by:
        sha in interface Deployment
      • ref

        @Nullable
        public String ref()
        The name of the ref. This can be a branch, tag, or SHA.
        Specified by:
        ref in interface Deployment
      • task

        @Nullable
        public String task()
        The name of the task
        Specified by:
        task in interface Deployment
      • environment

        @Nullable
        public String environment()
        The name of the environment that was deployed to. e.g. staging or production.
        Specified by:
        environment in interface Deployment
      • creator

        @Nullable
        public User creator()
        Deployment creator
        Specified by:
        creator in interface Deployment
      • statusesUrl

        @Nullable
        public URI statusesUrl()
        Deployment statuses API URL
        Specified by:
        statusesUrl in interface Deployment
      • repositoryUrl

        @Nullable
        public URI repositoryUrl()
        Deployment repository API URL
        Specified by:
        repositoryUrl in interface Deployment
      • withCreatedAt

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

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

        public final ImmutableDeployment 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 ImmutableDeployment 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
      • withRef

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

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

        public final ImmutableDeployment withPayload​(Map<String,​String> value)
        Copy the current immutable object by setting a present value for the optional payload attribute.
        Parameters:
        value - The value for payload
        Returns:
        A modified copy of this object
      • withPayload

        public final ImmutableDeployment withPayload​(Optional<? extends Map<String,​String>> optional)
        Copy the current immutable object by setting an optional value for the payload 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 payload
        Returns:
        A modified copy of this object
      • withEnvironment

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

        public final ImmutableDeployment 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 ImmutableDeployment 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
      • withCreator

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

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

        public final ImmutableDeployment withRepositoryUrl​(@Nullable
                                                           URI value)
        Copy the current immutable object by setting a value for the repositoryUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for repositoryUrl (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 ImmutableDeployment 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, url, id, sha, ref, task, payload, environment, description, creator, statusesUrl, repositoryUrl.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableDeployment.Builder builder()
        Creates a builder for ImmutableDeployment.
         ImmutableDeployment.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .url(java.net.URI | null) // nullable url
            .id(Long | null) // nullable id
            .sha(String | null) // nullable sha
            .ref(String | null) // nullable ref
            .task(String | null) // nullable task
            .payload(Map&lt;String, String&gt;) // optional payload
            .environment(String | null) // nullable environment
            .description(String) // optional description
            .creator(com.spotify.github.v3.User | null) // nullable creator
            .statusesUrl(java.net.URI | null) // nullable statusesUrl
            .repositoryUrl(java.net.URI | null) // nullable repositoryUrl
            .build();
         
        Returns:
        A new ImmutableDeployment builder