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 class
ImmutablePushCommit.Builder
Builds 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.Author
author()
Commit author.static ImmutablePushCommit.Builder
builder()
Creates a builder forImmutablePushCommit
.Author
committer()
Commit committer.static ImmutablePushCommit
copyOf(PushCommit instance)
Creates an immutable copy of aPushCommit
value.Boolean
distinct()
Whether this commit is distinct from any that have been pushed before..boolean
equals(Object another)
This instance is equal to all instances ofImmutablePushCommit
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:id
,treeId
,distinct
,message
,timestamp
,url
,author
,committer
,added
,removed
,modified
.String
id()
Commit id.String
message()
Commit message.List<String>
modified()
Files that were modified.List<String>
removed()
Files that were removed.ZonedDateTime
timestamp()
Timestamp.String
toString()
Prints the immutable valuePushCommit
with attribute values.String
treeId()
Tree id.URI
url()
Points to the commit API resource..ImmutablePushCommit
withAdded(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofadded
.ImmutablePushCommit
withAdded(String... elements)
Copy the current immutable object with elements that replace the content ofadded
.ImmutablePushCommit
withAuthor(Author value)
Copy the current immutable object by setting a value for theauthor
attribute.ImmutablePushCommit
withCommitter(Author value)
Copy the current immutable object by setting a value for thecommitter
attribute.ImmutablePushCommit
withDistinct(Boolean value)
Copy the current immutable object by setting a value for thedistinct
attribute.ImmutablePushCommit
withId(String value)
Copy the current immutable object by setting a value for theid
attribute.ImmutablePushCommit
withMessage(String value)
Copy the current immutable object by setting a value for themessage
attribute.ImmutablePushCommit
withModified(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofmodified
.ImmutablePushCommit
withModified(String... elements)
Copy the current immutable object with elements that replace the content ofmodified
.ImmutablePushCommit
withRemoved(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofremoved
.ImmutablePushCommit
withRemoved(String... elements)
Copy the current immutable object with elements that replace the content ofremoved
.ImmutablePushCommit
withTimestamp(ZonedDateTime value)
Copy the current immutable object by setting a value for thetimestamp
attribute.ImmutablePushCommit
withTreeId(String value)
Copy the current immutable object by setting a value for thetreeId
attribute.ImmutablePushCommit
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
id
@Nullable public String id()
Commit id.- Specified by:
id
in interfacePushCommit
-
treeId
@Nullable public String treeId()
Tree id.- Specified by:
treeId
in interfacePushCommit
-
distinct
@Nullable public Boolean distinct()
Whether this commit is distinct from any that have been pushed before..- Specified by:
distinct
in interfacePushCommit
-
message
@Nullable public String message()
Commit message.- Specified by:
message
in interfacePushCommit
-
timestamp
@Nullable public ZonedDateTime timestamp()
Timestamp.- Specified by:
timestamp
in interfacePushCommit
-
url
@Nullable public URI url()
Points to the commit API resource..- Specified by:
url
in interfacePushCommit
-
author
@Nullable public Author author()
Commit author.- Specified by:
author
in interfacePushCommit
-
committer
@Nullable public Author committer()
Commit committer.- Specified by:
committer
in interfacePushCommit
-
added
@Nullable public List<String> added()
Files that were added.- Specified by:
added
in interfacePushCommit
-
removed
@Nullable public List<String> removed()
Files that were removed.- Specified by:
removed
in interfacePushCommit
-
modified
@Nullable public List<String> modified()
Files that were modified.- Specified by:
modified
in interfacePushCommit
-
withId
public final ImmutablePushCommit withId(@Nullable String value)
Copy the current immutable object by setting a value for theid
attribute. 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
this
object
-
withTreeId
public final ImmutablePushCommit withTreeId(@Nullable String value)
Copy the current immutable object by setting a value for thetreeId
attribute. 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
this
object
-
withDistinct
public final ImmutablePushCommit withDistinct(@Nullable Boolean value)
Copy the current immutable object by setting a value for thedistinct
attribute. 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
this
object
-
withMessage
public final ImmutablePushCommit withMessage(@Nullable String value)
Copy the current immutable object by setting a value for themessage
attribute. 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
this
object
-
withTimestamp
public final ImmutablePushCommit withTimestamp(@Nullable ZonedDateTime value)
Copy the current immutable object by setting a value for thetimestamp
attribute. 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
this
object
-
withUrl
public final ImmutablePushCommit 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
-
withAuthor
public final ImmutablePushCommit withAuthor(@Nullable Author value)
Copy the current immutable object by setting a value for theauthor
attribute. 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
this
object
-
withCommitter
public final ImmutablePushCommit withCommitter(@Nullable Author value)
Copy the current immutable object by setting a value for thecommitter
attribute. 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
this
object
-
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
this
object
-
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
this
object
-
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
this
object
-
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
this
object
-
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
this
object
-
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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePushCommit
that 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 valuePushCommit
with attribute values.
-
copyOf
public static ImmutablePushCommit copyOf(PushCommit instance)
Creates an immutable copy of aPushCommit
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 PushCommit instance
-
builder
public static ImmutablePushCommit.Builder builder()
Creates a builder forImmutablePushCommit
.ImmutablePushCommit.builder() .id(String | null) // nullable
id
.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
-
-