Package com.spotify.github.v3.repos
Class ImmutableCommitItem
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableCommitItem
-
- All Implemented Interfaces:
ShaLink,CommitItem
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableCommitItem extends Object implements CommitItem
Immutable implementation ofCommitItem.Use the builder to create immutable instances:
ImmutableCommitItem.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableCommitItem.BuilderBuilds instances of typeImmutableCommitItem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<User>author()Author userstatic ImmutableCommitItem.Builderbuilder()Creates a builder forImmutableCommitItem.URIcommentsUrl()Comments URLCommitcommit()Commit detailsstatic ImmutableCommitItemcopyOf(CommitItem instance)Creates an immutable copy of aCommitItemvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableCommitItemthat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,url,commit,htmlUrl,commentsUrl,author,parents.URIhtmlUrl()HTML URLList<ShaLink>parents()The SHAs of the commits that were the parents of this commitStringsha()SHA.StringtoString()Prints the immutable valueCommitItemwith attribute values.URIurl()URL.ImmutableCommitItemwithAuthor(User value)Copy the current immutable object by setting a present value for the optionalauthorattribute.ImmutableCommitItemwithAuthor(Optional<? extends User> optional)Copy the current immutable object by setting an optional value for theauthorattribute.ImmutableCommitItemwithCommentsUrl(URI value)Copy the current immutable object by setting a value for thecommentsUrlattribute.ImmutableCommitItemwithCommit(Commit value)Copy the current immutable object by setting a value for thecommitattribute.ImmutableCommitItemwithHtmlUrl(URI value)Copy the current immutable object by setting a value for thehtmlUrlattribute.ImmutableCommitItemwithParents(ShaLink... elements)Copy the current immutable object with elements that replace the content ofparents.ImmutableCommitItemwithParents(Iterable<? extends ShaLink> elements)Copy the current immutable object with elements that replace the content ofparents.ImmutableCommitItemwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableCommitItemwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
commit
@Nullable public Commit commit()
Commit details- Specified by:
commitin interfaceCommitItem
-
htmlUrl
@Nullable public URI htmlUrl()
HTML URL- Specified by:
htmlUrlin interfaceCommitItem
-
commentsUrl
@Nullable public URI commentsUrl()
Comments URL- Specified by:
commentsUrlin interfaceCommitItem
-
author
public Optional<User> author()
Author user- Specified by:
authorin interfaceCommitItem
-
parents
@Nullable public List<ShaLink> parents()
The SHAs of the commits that were the parents of this commit- Specified by:
parentsin interfaceCommitItem
-
withSha
public final ImmutableCommitItem withSha(@Nullable String value)
Copy the current immutable object by setting a value for theshaattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sha (can benull)- Returns:
- A modified copy of the
thisobject
-
withUrl
public final ImmutableCommitItem withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommit
public final ImmutableCommitItem withCommit(@Nullable Commit value)
Copy the current immutable object by setting a value for thecommitattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commit (can benull)- Returns:
- A modified copy of the
thisobject
-
withHtmlUrl
public final ImmutableCommitItem withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for htmlUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommentsUrl
public final ImmutableCommitItem withCommentsUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecommentsUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commentsUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withAuthor
public final ImmutableCommitItem withAuthor(User value)
Copy the current immutable object by setting a present value for the optionalauthorattribute.- Parameters:
value- The value for author- Returns:
- A modified copy of
thisobject
-
withAuthor
public final ImmutableCommitItem withAuthor(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theauthorattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for author- Returns:
- A modified copy of
thisobject
-
withParents
public final ImmutableCommitItem withParents(@Nullable ShaLink... elements)
Copy the current immutable object with elements that replace the content ofparents.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withParents
public final ImmutableCommitItem withParents(@Nullable Iterable<? extends ShaLink> elements)
Copy the current immutable object with elements that replace the content ofparents. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of parents elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableCommitItemthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha,url,commit,htmlUrl,commentsUrl,author,parents.
-
toString
public String toString()
Prints the immutable valueCommitItemwith attribute values.
-
copyOf
public static ImmutableCommitItem copyOf(CommitItem instance)
Creates an immutable copy of aCommitItemvalue. 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 CommitItem instance
-
builder
public static ImmutableCommitItem.Builder builder()
Creates a builder forImmutableCommitItem.ImmutableCommitItem.builder() .sha(String | null) // nullablesha.url(java.net.URI | null) // nullableurl.commit(com.spotify.github.v3.git.Commit | null) // nullablecommit.htmlUrl(java.net.URI | null) // nullablehtmlUrl.commentsUrl(java.net.URI | null) // nullablecommentsUrl.author(com.spotify.github.v3.User) // optionalauthor.parents(List<com.spotify.github.v3.git.ShaLink> | null) // nullableparents.build();- Returns:
- A new ImmutableCommitItem builder
-
-