Class ImmutablePushCommit

  • All Implemented Interfaces:
    PushCommit

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

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

    • Method Detail

      • distinct

        @Nullable
        public Boolean distinct()
        Whether this commit is distinct from any that have been pushed before..
        Specified by:
        distinct in interface PushCommit
      • url

        @Nullable
        public URI url()
        Points to the commit API resource..
        Specified by:
        url in interface PushCommit
      • withId

        public final ImmutablePushCommit withId​(@Nullable
                                                String 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
      • withTreeId

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

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

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

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

        public final ImmutablePushCommit 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
      • withAuthor

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

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

        public final ImmutablePushCommit withAdded​(@Nullable
                                                   String... elements)
        Copy the current immutable object with elements that replace the content of added.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withAdded

        public final ImmutablePushCommit withAdded​(@Nullable
                                                   Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of added. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of added elements to set
        Returns:
        A modified copy of this object
      • withRemoved

        public final ImmutablePushCommit withRemoved​(@Nullable
                                                     String... elements)
        Copy the current immutable object with elements that replace the content of removed.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withRemoved

        public final ImmutablePushCommit withRemoved​(@Nullable
                                                     Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of removed. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of removed elements to set
        Returns:
        A modified copy of this object
      • withModified

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

        public final ImmutablePushCommit withModified​(@Nullable
                                                      Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of modified. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of modified 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 ImmutablePushCommit 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: id, treeId, distinct, message, timestamp, url, author, committer, added, removed, modified.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutablePushCommit.Builder builder()
        Creates a builder for ImmutablePushCommit.
         ImmutablePushCommit.builder()
            .id(String | null) // nullable id
            .treeId(String | null) // nullable treeId
            .distinct(Boolean | null) // nullable distinct
            .message(String | null) // nullable message
            .timestamp(java.time.ZonedDateTime | null) // nullable timestamp
            .url(java.net.URI | null) // nullable url
            .author(com.spotify.github.v3.git.Author | null) // nullable author
            .committer(com.spotify.github.v3.git.Author | null) // nullable committer
            .added(List&lt;String&gt; | null) // nullable added
            .removed(List&lt;String&gt; | null) // nullable removed
            .modified(List&lt;String&gt; | null) // nullable modified
            .build();
         
        Returns:
        A new ImmutablePushCommit builder