Package com.spotify.github.v3.repos
Class ImmutableCommitComparison.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableCommitComparison.Builder
-
- Enclosing class:
- ImmutableCommitComparison
@NotThreadSafe public static final class ImmutableCommitComparison.Builder extends Object
Builds instances of typeImmutableCommitComparison. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder from(CommitComparison instance)
Fill a builder with attribute values from the providedCommitComparisoninstance. 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:
thisbuilder for use in a chained invocation
-
baseCommit
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder baseCommit(@Nullable Commit baseCommit)
Initializes the value for thebaseCommitattribute.- Parameters:
baseCommit- The value for baseCommit (can benull)- Returns:
thisbuilder for use in a chained invocation
-
mergeBaseCommit
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder mergeBaseCommit(@Nullable Commit mergeBaseCommit)
Initializes the value for themergeBaseCommitattribute.- Parameters:
mergeBaseCommit- The value for mergeBaseCommit (can benull)- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder status(@Nullable String status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status (can benull)- Returns:
thisbuilder for use in a chained invocation
-
aheadBy
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder aheadBy(int aheadBy)
Initializes the value for theaheadByattribute.- Parameters:
aheadBy- The value for aheadBy- Returns:
thisbuilder for use in a chained invocation
-
behindBy
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder behindBy(int behindBy)
Initializes the value for thebehindByattribute.- Parameters:
behindBy- The value for behindBy- Returns:
thisbuilder for use in a chained invocation
-
addCommits
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addCommits(Commit element)
Adds one element tocommitslist.- Parameters:
element- A commits element- Returns:
thisbuilder for use in a chained invocation
-
addCommits
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addCommits(Commit... elements)
Adds elements tocommitslist.- Parameters:
elements- An array of commits elements- Returns:
thisbuilder for use in a chained invocation
-
commits
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder commits(@Nullable Iterable<? extends Commit> elements)
Sets or replaces all elements forcommitslist.- Parameters:
elements- An iterable of commits elements- Returns:
thisbuilder for use in a chained invocation
-
addAllCommits
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addAllCommits(Iterable<? extends Commit> elements)
Adds elements tocommitslist.- Parameters:
elements- An iterable of commits elements- Returns:
thisbuilder for use in a chained invocation
-
addFiles
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addFiles(File element)
Adds one element tofileslist.- Parameters:
element- A files element- Returns:
thisbuilder for use in a chained invocation
-
addFiles
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addFiles(File... elements)
Adds elements tofileslist.- Parameters:
elements- An array of files elements- Returns:
thisbuilder for use in a chained invocation
-
files
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder files(@Nullable Iterable<? extends File> elements)
Sets or replaces all elements forfileslist.- Parameters:
elements- An iterable of files elements- Returns:
thisbuilder for use in a chained invocation
-
addAllFiles
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder addAllFiles(Iterable<? extends File> elements)
Adds elements tofileslist.- Parameters:
elements- An iterable of files elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCommitComparison build()
Builds a newImmutableCommitComparison.- Returns:
- An immutable instance of CommitComparison
- Throws:
IllegalStateException- if any required attributes are missing
-
-