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 classImmutableCommitComparison.BuilderBuilds instances of typeImmutableCommitComparison.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaheadBy()Ahead byCommitbaseCommit()BaseintbehindBy()Behind bystatic ImmutableCommitComparison.Builderbuilder()Creates a builder forImmutableCommitComparison.List<Commit>commits()Commitsstatic ImmutableCommitComparisoncopyOf(CommitComparison instance)Creates an immutable copy of aCommitComparisonvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableCommitComparisonthat have equal attribute values.List<File>files()FilesinthashCode()Computes a hash code from attributes:baseCommit,mergeBaseCommit,status,aheadBy,behindBy,commits,files.CommitmergeBaseCommit()Merge baseStringstatus()StatusStringtoString()Prints the immutable valueCommitComparisonwith attribute values.ImmutableCommitComparisonwithAheadBy(int value)Copy the current immutable object by setting a value for theaheadByattribute.ImmutableCommitComparisonwithBaseCommit(Commit value)Copy the current immutable object by setting a value for thebaseCommitattribute.ImmutableCommitComparisonwithBehindBy(int value)Copy the current immutable object by setting a value for thebehindByattribute.ImmutableCommitComparisonwithCommits(Commit... elements)Copy the current immutable object with elements that replace the content ofcommits.ImmutableCommitComparisonwithCommits(Iterable<? extends Commit> elements)Copy the current immutable object with elements that replace the content ofcommits.ImmutableCommitComparisonwithFiles(File... elements)Copy the current immutable object with elements that replace the content offiles.ImmutableCommitComparisonwithFiles(Iterable<? extends File> elements)Copy the current immutable object with elements that replace the content offiles.ImmutableCommitComparisonwithMergeBaseCommit(Commit value)Copy the current immutable object by setting a value for themergeBaseCommitattribute.ImmutableCommitComparisonwithStatus(String value)Copy the current immutable object by setting a value for thestatusattribute.
-
-
-
Method Detail
-
baseCommit
@Nullable public Commit baseCommit()
Base- Specified by:
baseCommitin interfaceCommitComparison
-
mergeBaseCommit
@Nullable public Commit mergeBaseCommit()
Merge base- Specified by:
mergeBaseCommitin interfaceCommitComparison
-
status
@Nullable public String status()
Status- Specified by:
statusin interfaceCommitComparison
-
aheadBy
public int aheadBy()
Ahead by- Specified by:
aheadByin interfaceCommitComparison
-
behindBy
public int behindBy()
Behind by- Specified by:
behindByin interfaceCommitComparison
-
commits
@Nullable public List<Commit> commits()
Commits- Specified by:
commitsin interfaceCommitComparison
-
files
@Nullable public List<File> files()
Files- Specified by:
filesin interfaceCommitComparison
-
withBaseCommit
public final ImmutableCommitComparison withBaseCommit(@Nullable Commit value)
Copy the current immutable object by setting a value for thebaseCommitattribute. 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
thisobject
-
withMergeBaseCommit
public final ImmutableCommitComparison withMergeBaseCommit(@Nullable Commit value)
Copy the current immutable object by setting a value for themergeBaseCommitattribute. 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
thisobject
-
withStatus
public final ImmutableCommitComparison withStatus(@Nullable String value)
Copy the current immutable object by setting a value for thestatusattribute. 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
thisobject
-
withAheadBy
public final ImmutableCommitComparison withAheadBy(int value)
Copy the current immutable object by setting a value for theaheadByattribute. 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
thisobject
-
withBehindBy
public final ImmutableCommitComparison withBehindBy(int value)
Copy the current immutable object by setting a value for thebehindByattribute. 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
thisobject
-
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
thisobject
-
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
thisobject
-
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
thisobject
-
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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCommitComparisonthat 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 valueCommitComparisonwith attribute values.
-
copyOf
public static ImmutableCommitComparison copyOf(CommitComparison instance)
Creates an immutable copy of aCommitComparisonvalue. 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) // nullablebaseCommit.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
-
-