Package com.spotify.github.v3.repos
Class ImmutablePushCommit.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutablePushCommit.Builder
-
- Enclosing class:
- ImmutablePushCommit
@NotThreadSafe public static final class ImmutablePushCommit.Builder extends Object
Builds instances of typeImmutablePushCommit. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutablePushCommit.BuilderaddAdded(String element)Adds one element toaddedlist.ImmutablePushCommit.BuilderaddAdded(String... elements)Adds elements toaddedlist.ImmutablePushCommit.BuilderaddAllAdded(Iterable<String> elements)Adds elements toaddedlist.ImmutablePushCommit.BuilderaddAllModified(Iterable<String> elements)Adds elements tomodifiedlist.ImmutablePushCommit.BuilderaddAllRemoved(Iterable<String> elements)Adds elements toremovedlist.ImmutablePushCommit.Builderadded(Iterable<String> elements)Sets or replaces all elements foraddedlist.ImmutablePushCommit.BuilderaddModified(String element)Adds one element tomodifiedlist.ImmutablePushCommit.BuilderaddModified(String... elements)Adds elements tomodifiedlist.ImmutablePushCommit.BuilderaddRemoved(String element)Adds one element toremovedlist.ImmutablePushCommit.BuilderaddRemoved(String... elements)Adds elements toremovedlist.ImmutablePushCommit.Builderauthor(Author author)Initializes the value for theauthorattribute.ImmutablePushCommitbuild()Builds a newImmutablePushCommit.ImmutablePushCommit.Buildercommitter(Author committer)Initializes the value for thecommitterattribute.ImmutablePushCommit.Builderdistinct(Boolean distinct)Initializes the value for thedistinctattribute.ImmutablePushCommit.Builderfrom(PushCommit instance)Fill a builder with attribute values from the providedPushCommitinstance.ImmutablePushCommit.Builderid(String id)Initializes the value for theidattribute.ImmutablePushCommit.Buildermessage(String message)Initializes the value for themessageattribute.ImmutablePushCommit.Buildermodified(Iterable<String> elements)Sets or replaces all elements formodifiedlist.ImmutablePushCommit.Builderremoved(Iterable<String> elements)Sets or replaces all elements forremovedlist.ImmutablePushCommit.Buildertimestamp(ZonedDateTime timestamp)Initializes the value for thetimestampattribute.ImmutablePushCommit.BuildertreeId(String treeId)Initializes the value for thetreeIdattribute.ImmutablePushCommit.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder from(PushCommit instance)
Fill a builder with attribute values from the providedPushCommitinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder id(@Nullable String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
treeId
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder treeId(@Nullable String treeId)
Initializes the value for thetreeIdattribute.- Parameters:
treeId- The value for treeId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
distinct
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder distinct(@Nullable Boolean distinct)
Initializes the value for thedistinctattribute.- Parameters:
distinct- The value for distinct (can benull)- Returns:
thisbuilder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder message(@Nullable String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message (can benull)- Returns:
thisbuilder for use in a chained invocation
-
timestamp
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder timestamp(@Nullable ZonedDateTime timestamp)
Initializes the value for thetimestampattribute.- Parameters:
timestamp- The value for timestamp (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
author
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder author(@Nullable Author author)
Initializes the value for theauthorattribute.- Parameters:
author- The value for author (can benull)- Returns:
thisbuilder for use in a chained invocation
-
committer
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder committer(@Nullable Author committer)
Initializes the value for thecommitterattribute.- Parameters:
committer- The value for committer (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAdded(String element)
Adds one element toaddedlist.- Parameters:
element- A added element- Returns:
thisbuilder for use in a chained invocation
-
addAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAdded(String... elements)
Adds elements toaddedlist.- Parameters:
elements- An array of added elements- Returns:
thisbuilder for use in a chained invocation
-
added
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder added(@Nullable Iterable<String> elements)
Sets or replaces all elements foraddedlist.- Parameters:
elements- An iterable of added elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllAdded(Iterable<String> elements)
Adds elements toaddedlist.- Parameters:
elements- An iterable of added elements- Returns:
thisbuilder for use in a chained invocation
-
addRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addRemoved(String element)
Adds one element toremovedlist.- Parameters:
element- A removed element- Returns:
thisbuilder for use in a chained invocation
-
addRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addRemoved(String... elements)
Adds elements toremovedlist.- Parameters:
elements- An array of removed elements- Returns:
thisbuilder for use in a chained invocation
-
removed
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder removed(@Nullable Iterable<String> elements)
Sets or replaces all elements forremovedlist.- Parameters:
elements- An iterable of removed elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllRemoved(Iterable<String> elements)
Adds elements toremovedlist.- Parameters:
elements- An iterable of removed elements- Returns:
thisbuilder for use in a chained invocation
-
addModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addModified(String element)
Adds one element tomodifiedlist.- Parameters:
element- A modified element- Returns:
thisbuilder for use in a chained invocation
-
addModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addModified(String... elements)
Adds elements tomodifiedlist.- Parameters:
elements- An array of modified elements- Returns:
thisbuilder for use in a chained invocation
-
modified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder modified(@Nullable Iterable<String> elements)
Sets or replaces all elements formodifiedlist.- Parameters:
elements- An iterable of modified elements- Returns:
thisbuilder for use in a chained invocation
-
addAllModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllModified(Iterable<String> elements)
Adds elements tomodifiedlist.- Parameters:
elements- An iterable of modified elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePushCommit build()
Builds a newImmutablePushCommit.- Returns:
- An immutable instance of PushCommit
- Throws:
IllegalStateException- if any required attributes are missing
-
-