Package com.spotify.github.v3.repos
Class ImmutablePushCommit
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutablePushCommit
-
- All Implemented Interfaces:
PushCommit
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePushCommit extends Object implements PushCommit
Immutable implementation ofPushCommit.Use the builder to create immutable instances:
ImmutablePushCommit.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePushCommit.BuilderBuilds instances of typeImmutablePushCommit.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>added()Files that were added.Authorauthor()Commit author.static ImmutablePushCommit.Builderbuilder()Creates a builder forImmutablePushCommit.Authorcommitter()Commit committer.static ImmutablePushCommitcopyOf(PushCommit instance)Creates an immutable copy of aPushCommitvalue.Booleandistinct()Whether this commit is distinct from any that have been pushed before..booleanequals(Object another)This instance is equal to all instances ofImmutablePushCommitthat have equal attribute values.inthashCode()Computes a hash code from attributes:id,treeId,distinct,message,timestamp,url,author,committer,added,removed,modified.Stringid()Commit id.Stringmessage()Commit message.List<String>modified()Files that were modified.List<String>removed()Files that were removed.ZonedDateTimetimestamp()Timestamp.StringtoString()Prints the immutable valuePushCommitwith attribute values.StringtreeId()Tree id.URIurl()Points to the commit API resource..ImmutablePushCommitwithAdded(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofadded.ImmutablePushCommitwithAdded(String... elements)Copy the current immutable object with elements that replace the content ofadded.ImmutablePushCommitwithAuthor(Author value)Copy the current immutable object by setting a value for theauthorattribute.ImmutablePushCommitwithCommitter(Author value)Copy the current immutable object by setting a value for thecommitterattribute.ImmutablePushCommitwithDistinct(Boolean value)Copy the current immutable object by setting a value for thedistinctattribute.ImmutablePushCommitwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutablePushCommitwithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.ImmutablePushCommitwithModified(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofmodified.ImmutablePushCommitwithModified(String... elements)Copy the current immutable object with elements that replace the content ofmodified.ImmutablePushCommitwithRemoved(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofremoved.ImmutablePushCommitwithRemoved(String... elements)Copy the current immutable object with elements that replace the content ofremoved.ImmutablePushCommitwithTimestamp(ZonedDateTime value)Copy the current immutable object by setting a value for thetimestampattribute.ImmutablePushCommitwithTreeId(String value)Copy the current immutable object by setting a value for thetreeIdattribute.ImmutablePushCommitwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
id
@Nullable public String id()
Commit id.- Specified by:
idin interfacePushCommit
-
treeId
@Nullable public String treeId()
Tree id.- Specified by:
treeIdin interfacePushCommit
-
distinct
@Nullable public Boolean distinct()
Whether this commit is distinct from any that have been pushed before..- Specified by:
distinctin interfacePushCommit
-
message
@Nullable public String message()
Commit message.- Specified by:
messagein interfacePushCommit
-
timestamp
@Nullable public ZonedDateTime timestamp()
Timestamp.- Specified by:
timestampin interfacePushCommit
-
url
@Nullable public URI url()
Points to the commit API resource..- Specified by:
urlin interfacePushCommit
-
author
@Nullable public Author author()
Commit author.- Specified by:
authorin interfacePushCommit
-
committer
@Nullable public Author committer()
Commit committer.- Specified by:
committerin interfacePushCommit
-
added
@Nullable public List<String> added()
Files that were added.- Specified by:
addedin interfacePushCommit
-
removed
@Nullable public List<String> removed()
Files that were removed.- Specified by:
removedin interfacePushCommit
-
modified
@Nullable public List<String> modified()
Files that were modified.- Specified by:
modifiedin interfacePushCommit
-
withId
public final ImmutablePushCommit withId(@Nullable String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withTreeId
public final ImmutablePushCommit withTreeId(@Nullable String value)
Copy the current immutable object by setting a value for thetreeIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for treeId (can benull)- Returns:
- A modified copy of the
thisobject
-
withDistinct
public final ImmutablePushCommit withDistinct(@Nullable Boolean value)
Copy the current immutable object by setting a value for thedistinctattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for distinct (can benull)- Returns:
- A modified copy of the
thisobject
-
withMessage
public final ImmutablePushCommit withMessage(@Nullable String value)
Copy the current immutable object by setting a value for themessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for message (can benull)- Returns:
- A modified copy of the
thisobject
-
withTimestamp
public final ImmutablePushCommit withTimestamp(@Nullable ZonedDateTime value)
Copy the current immutable object by setting a value for thetimestampattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timestamp (can benull)- Returns:
- A modified copy of the
thisobject
-
withUrl
public final ImmutablePushCommit 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
-
withAuthor
public final ImmutablePushCommit withAuthor(@Nullable Author value)
Copy the current immutable object by setting a value for theauthorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for author (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommitter
public final ImmutablePushCommit withCommitter(@Nullable Author value)
Copy the current immutable object by setting a value for thecommitterattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for committer (can benull)- Returns:
- A modified copy of the
thisobject
-
withAdded
public final ImmutablePushCommit withAdded(@Nullable String... elements)
Copy the current immutable object with elements that replace the content ofadded.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAdded
public final ImmutablePushCommit withAdded(@Nullable Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofadded. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of added elements to set- Returns:
- A modified copy of
thisobject
-
withRemoved
public final ImmutablePushCommit withRemoved(@Nullable String... elements)
Copy the current immutable object with elements that replace the content ofremoved.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withRemoved
public final ImmutablePushCommit withRemoved(@Nullable Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofremoved. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of removed elements to set- Returns:
- A modified copy of
thisobject
-
withModified
public final ImmutablePushCommit withModified(@Nullable String... elements)
Copy the current immutable object with elements that replace the content ofmodified.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withModified
public final ImmutablePushCommit withModified(@Nullable Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofmodified. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of modified elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePushCommitthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,treeId,distinct,message,timestamp,url,author,committer,added,removed,modified.
-
toString
public String toString()
Prints the immutable valuePushCommitwith attribute values.
-
copyOf
public static ImmutablePushCommit copyOf(PushCommit instance)
Creates an immutable copy of aPushCommitvalue. 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 PushCommit instance
-
builder
public static ImmutablePushCommit.Builder builder()
Creates a builder forImmutablePushCommit.ImmutablePushCommit.builder() .id(String | null) // nullableid.treeId(String | null) // nullabletreeId.distinct(Boolean | null) // nullabledistinct.message(String | null) // nullablemessage.timestamp(java.time.ZonedDateTime | null) // nullabletimestamp.url(java.net.URI | null) // nullableurl.author(com.spotify.github.v3.git.Author | null) // nullableauthor.committer(com.spotify.github.v3.git.Author | null) // nullablecommitter.added(List<String> | null) // nullableadded.removed(List<String> | null) // nullableremoved.modified(List<String> | null) // nullablemodified.build();- Returns:
- A new ImmutablePushCommit builder
-
-