Class ImmutableCommitComparison

  • All Implemented Interfaces:
    CommitComparison

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

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

    • Method Detail

      • withBaseCommit

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

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

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

        public final ImmutableCommitComparison withAheadBy​(int value)
        Copy the current immutable object by setting a value for the aheadBy attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for aheadBy
        Returns:
        A modified copy of the this object
      • withBehindBy

        public final ImmutableCommitComparison withBehindBy​(int value)
        Copy the current immutable object by setting a value for the behindBy attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for behindBy
        Returns:
        A modified copy of the this object
      • withCommits

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

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

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

        public final ImmutableCommitComparison withFiles​(@Nullable
                                                         Iterable<? extends File> elements)
        Copy the current immutable object with elements that replace the content of files. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of files 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 ImmutableCommitComparison 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: baseCommit, mergeBaseCommit, status, aheadBy, behindBy, commits, files.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableCommitComparison.Builder builder()
        Creates a builder for ImmutableCommitComparison.
         ImmutableCommitComparison.builder()
            .baseCommit(com.spotify.github.v3.repos.Commit | null) // nullable baseCommit
            .mergeBaseCommit(com.spotify.github.v3.repos.Commit | null) // nullable mergeBaseCommit
            .status(String | null) // nullable status
            .aheadBy(int) // required aheadBy
            .behindBy(int) // required behindBy
            .commits(List&lt;com.spotify.github.v3.repos.Commit&gt; | null) // nullable commits
            .files(List&lt;com.spotify.github.v3.repos.File&gt; | null) // nullable files
            .build();
         
        Returns:
        A new ImmutableCommitComparison builder