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.Builder
is 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 providedCommitComparison
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 thebaseCommit
attribute.- Parameters:
baseCommit
- The value for baseCommit (can benull
)- Returns:
this
builder for use in a chained invocation
-
mergeBaseCommit
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder mergeBaseCommit(@Nullable Commit mergeBaseCommit)
Initializes the value for themergeBaseCommit
attribute.- Parameters:
mergeBaseCommit
- The value for mergeBaseCommit (can benull
)- Returns:
this
builder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder status(@Nullable String status)
Initializes the value for thestatus
attribute.- Parameters:
status
- The value for status (can benull
)- Returns:
this
builder for use in a chained invocation
-
aheadBy
@CanIgnoreReturnValue public final ImmutableCommitComparison.Builder aheadBy(int aheadBy)
Initializes the value for theaheadBy
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 thebehindBy
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 tocommits
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 tocommits
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 forcommits
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 tocommits
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 tofiles
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 tofiles
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 forfiles
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 tofiles
list.- Parameters:
elements
- An iterable of files elements- Returns:
this
builder 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
-
-