Class ImmutableCommitStatus

  • All Implemented Interfaces:
    CommitStatus

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

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

    • Method Detail

      • state

        @Nullable
        public String state()
        The result of the status. Can be success, failure or pending.
        Specified by:
        state in interface CommitStatus
        Returns:
        the string
      • sha

        @Nullable
        public String sha()
        The commit SHA.
        Specified by:
        sha in interface CommitStatus
        Returns:
        the string
      • withState

        public final ImmutableCommitStatus 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
      • withStatuses

        public final ImmutableCommitStatus withStatuses​(@Nullable
                                                        Status... elements)
        Copy the current immutable object with elements that replace the content of statuses.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withStatuses

        public final ImmutableCommitStatus withStatuses​(@Nullable
                                                        Iterable<? extends Status> elements)
        Copy the current immutable object with elements that replace the content of statuses. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of statuses elements to set
        Returns:
        A modified copy of this object
      • withSha

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

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableCommitStatus 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: state, statuses, sha.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableCommitStatus.Builder builder()
        Creates a builder for ImmutableCommitStatus.
         ImmutableCommitStatus.builder()
            .state(String | null) // nullable state
            .statuses(List&lt;com.spotify.github.v3.repos.Status&gt; | null) // nullable statuses
            .sha(String | null) // nullable sha
            .build();
         
        Returns:
        A new ImmutableCommitStatus builder