Package com.spotify.github.v3.repos
Class ImmutableCommitComparison
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableCommitComparison
-
- All Implemented Interfaces:
CommitComparison
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCommitComparison extends Object implements CommitComparison
Immutable implementation ofCommitComparison
.Use the builder to create immutable instances:
ImmutableCommitComparison.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableCommitComparison.Builder
Builds instances of typeImmutableCommitComparison
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
aheadBy()
Ahead byCommit
baseCommit()
Baseint
behindBy()
Behind bystatic ImmutableCommitComparison.Builder
builder()
Creates a builder forImmutableCommitComparison
.List<Commit>
commits()
Commitsstatic ImmutableCommitComparison
copyOf(CommitComparison instance)
Creates an immutable copy of aCommitComparison
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableCommitComparison
that have equal attribute values.List<File>
files()
Filesint
hashCode()
Computes a hash code from attributes:baseCommit
,mergeBaseCommit
,status
,aheadBy
,behindBy
,commits
,files
.Commit
mergeBaseCommit()
Merge baseString
status()
StatusString
toString()
Prints the immutable valueCommitComparison
with attribute values.ImmutableCommitComparison
withAheadBy(int value)
Copy the current immutable object by setting a value for theaheadBy
attribute.ImmutableCommitComparison
withBaseCommit(Commit value)
Copy the current immutable object by setting a value for thebaseCommit
attribute.ImmutableCommitComparison
withBehindBy(int value)
Copy the current immutable object by setting a value for thebehindBy
attribute.ImmutableCommitComparison
withCommits(Commit... elements)
Copy the current immutable object with elements that replace the content ofcommits
.ImmutableCommitComparison
withCommits(Iterable<? extends Commit> elements)
Copy the current immutable object with elements that replace the content ofcommits
.ImmutableCommitComparison
withFiles(File... elements)
Copy the current immutable object with elements that replace the content offiles
.ImmutableCommitComparison
withFiles(Iterable<? extends File> elements)
Copy the current immutable object with elements that replace the content offiles
.ImmutableCommitComparison
withMergeBaseCommit(Commit value)
Copy the current immutable object by setting a value for themergeBaseCommit
attribute.ImmutableCommitComparison
withStatus(String value)
Copy the current immutable object by setting a value for thestatus
attribute.
-
-
-
Method Detail
-
baseCommit
@Nullable public Commit baseCommit()
Base- Specified by:
baseCommit
in interfaceCommitComparison
-
mergeBaseCommit
@Nullable public Commit mergeBaseCommit()
Merge base- Specified by:
mergeBaseCommit
in interfaceCommitComparison
-
status
@Nullable public String status()
Status- Specified by:
status
in interfaceCommitComparison
-
aheadBy
public int aheadBy()
Ahead by- Specified by:
aheadBy
in interfaceCommitComparison
-
behindBy
public int behindBy()
Behind by- Specified by:
behindBy
in interfaceCommitComparison
-
commits
@Nullable public List<Commit> commits()
Commits- Specified by:
commits
in interfaceCommitComparison
-
files
@Nullable public List<File> files()
Files- Specified by:
files
in interfaceCommitComparison
-
withBaseCommit
public final ImmutableCommitComparison withBaseCommit(@Nullable Commit value)
Copy the current immutable object by setting a value for thebaseCommit
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for baseCommit (can benull
)- 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 themergeBaseCommit
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mergeBaseCommit (can benull
)- 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 thestatus
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for status (can benull
)- 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 theaheadBy
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 thebehindBy
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 ofcommits
.- 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 ofcommits
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 offiles
.- 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 offiles
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 ofImmutableCommitComparison
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:baseCommit
,mergeBaseCommit
,status
,aheadBy
,behindBy
,commits
,files
.
-
toString
public String toString()
Prints the immutable valueCommitComparison
with attribute values.
-
copyOf
public static ImmutableCommitComparison copyOf(CommitComparison instance)
Creates an immutable copy of aCommitComparison
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 forImmutableCommitComparison
.ImmutableCommitComparison.builder() .baseCommit(com.spotify.github.v3.repos.Commit | null) // nullable
baseCommit
.mergeBaseCommit(com.spotify.github.v3.repos.Commit | null) // nullablemergeBaseCommit
.status(String | null) // nullablestatus
.aheadBy(int) // requiredaheadBy
.behindBy(int) // requiredbehindBy
.commits(List<com.spotify.github.v3.repos.Commit> | null) // nullablecommits
.files(List<com.spotify.github.v3.repos.File> | null) // nullablefiles
.build();- Returns:
- A new ImmutableCommitComparison builder
-
-