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 class
ImmutableCommitItem.Builder
Builds instances of typeImmutableCommitItem
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<User>
author()
Author userstatic ImmutableCommitItem.Builder
builder()
Creates a builder forImmutableCommitItem
.URI
commentsUrl()
Comments URLCommit
commit()
Commit detailsstatic ImmutableCommitItem
copyOf(CommitItem instance)
Creates an immutable copy of aCommitItem
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableCommitItem
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,url
,commit
,htmlUrl
,commentsUrl
,author
,parents
.URI
htmlUrl()
HTML URLList<ShaLink>
parents()
The SHAs of the commits that were the parents of this commitString
sha()
SHA.String
toString()
Prints the immutable valueCommitItem
with attribute values.URI
url()
URL.ImmutableCommitItem
withAuthor(User value)
Copy the current immutable object by setting a present value for the optionalauthor
attribute.ImmutableCommitItem
withAuthor(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theauthor
attribute.ImmutableCommitItem
withCommentsUrl(URI value)
Copy the current immutable object by setting a value for thecommentsUrl
attribute.ImmutableCommitItem
withCommit(Commit value)
Copy the current immutable object by setting a value for thecommit
attribute.ImmutableCommitItem
withHtmlUrl(URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableCommitItem
withParents(ShaLink... elements)
Copy the current immutable object with elements that replace the content ofparents
.ImmutableCommitItem
withParents(Iterable<? extends ShaLink> elements)
Copy the current immutable object with elements that replace the content ofparents
.ImmutableCommitItem
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableCommitItem
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
commit
@Nullable public Commit commit()
Commit details- Specified by:
commit
in interfaceCommitItem
-
htmlUrl
@Nullable public URI htmlUrl()
HTML URL- Specified by:
htmlUrl
in interfaceCommitItem
-
commentsUrl
@Nullable public URI commentsUrl()
Comments URL- Specified by:
commentsUrl
in interfaceCommitItem
-
author
public Optional<User> author()
Author user- Specified by:
author
in interfaceCommitItem
-
parents
@Nullable public List<ShaLink> parents()
The SHAs of the commits that were the parents of this commit- Specified by:
parents
in interfaceCommitItem
-
withSha
public final ImmutableCommitItem withSha(@Nullable String value)
Copy the current immutable object by setting a value for thesha
attribute. 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
this
object
-
withUrl
public final ImmutableCommitItem withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
withCommit
public final ImmutableCommitItem withCommit(@Nullable Commit value)
Copy the current immutable object by setting a value for thecommit
attribute. 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
this
object
-
withHtmlUrl
public final ImmutableCommitItem withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute. 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
this
object
-
withCommentsUrl
public final ImmutableCommitItem withCommentsUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecommentsUrl
attribute. 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
this
object
-
withAuthor
public final ImmutableCommitItem withAuthor(User value)
Copy the current immutable object by setting a present value for the optionalauthor
attribute.- Parameters:
value
- The value for author- Returns:
- A modified copy of
this
object
-
withAuthor
public final ImmutableCommitItem withAuthor(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theauthor
attribute. 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
this
object
-
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
this
object
-
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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableCommitItem
that 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 valueCommitItem
with attribute values.
-
copyOf
public static ImmutableCommitItem copyOf(CommitItem instance)
Creates an immutable copy of aCommitItem
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 CommitItem instance
-
builder
public static ImmutableCommitItem.Builder builder()
Creates a builder forImmutableCommitItem
.ImmutableCommitItem.builder() .sha(String | null) // nullable
sha
.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
-
-