Class ImmutableCommitComparison.Builder

  • Enclosing class:
    ImmutableCommitComparison

    @NotThreadSafe
    public static final class ImmutableCommitComparison.Builder
    extends Object
    Builds instances of type ImmutableCommitComparison. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder from​(CommitComparison instance)
        Fill a builder with attribute values from the provided CommitComparison instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • baseCommit

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder baseCommit​(@Nullable
                                                                  Commit baseCommit)
        Initializes the value for the baseCommit attribute.
        Parameters:
        baseCommit - The value for baseCommit (can be null)
        Returns:
        this builder for use in a chained invocation
      • mergeBaseCommit

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder mergeBaseCommit​(@Nullable
                                                                       Commit mergeBaseCommit)
        Initializes the value for the mergeBaseCommit attribute.
        Parameters:
        mergeBaseCommit - The value for mergeBaseCommit (can be null)
        Returns:
        this builder for use in a chained invocation
      • status

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder status​(@Nullable
                                                              String status)
        Initializes the value for the status attribute.
        Parameters:
        status - The value for status (can be null)
        Returns:
        this builder for use in a chained invocation
      • aheadBy

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder aheadBy​(int aheadBy)
        Initializes the value for the aheadBy attribute.
        Parameters:
        aheadBy - The value for aheadBy
        Returns:
        this builder for use in a chained invocation
      • behindBy

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder behindBy​(int behindBy)
        Initializes the value for the behindBy attribute.
        Parameters:
        behindBy - The value for behindBy
        Returns:
        this builder for use in a chained invocation
      • addCommits

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addCommits​(Commit element)
        Adds one element to commits list.
        Parameters:
        element - A commits element
        Returns:
        this builder for use in a chained invocation
      • addCommits

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addCommits​(Commit... elements)
        Adds elements to commits list.
        Parameters:
        elements - An array of commits elements
        Returns:
        this builder for use in a chained invocation
      • commits

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder commits​(@Nullable
                                                               Iterable<? extends Commit> elements)
        Sets or replaces all elements for commits list.
        Parameters:
        elements - An iterable of commits elements
        Returns:
        this builder for use in a chained invocation
      • addAllCommits

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addAllCommits​(Iterable<? extends Commit> elements)
        Adds elements to commits list.
        Parameters:
        elements - An iterable of commits elements
        Returns:
        this builder for use in a chained invocation
      • addFiles

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addFiles​(File element)
        Adds one element to files list.
        Parameters:
        element - A files element
        Returns:
        this builder for use in a chained invocation
      • addFiles

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addFiles​(File... elements)
        Adds elements to files list.
        Parameters:
        elements - An array of files elements
        Returns:
        this builder for use in a chained invocation
      • files

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder files​(@Nullable
                                                             Iterable<? extends File> elements)
        Sets or replaces all elements for files list.
        Parameters:
        elements - An iterable of files elements
        Returns:
        this builder for use in a chained invocation
      • addAllFiles

        @CanIgnoreReturnValue
        public final ImmutableCommitComparison.Builder addAllFiles​(Iterable<? extends File> elements)
        Adds elements to files list.
        Parameters:
        elements - An iterable of files elements
        Returns:
        this builder for use in a chained invocation