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.Builder
is 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.Builder
addAdded(String element)
Adds one element toadded
list.ImmutablePushCommit.Builder
addAdded(String... elements)
Adds elements toadded
list.ImmutablePushCommit.Builder
addAllAdded(Iterable<String> elements)
Adds elements toadded
list.ImmutablePushCommit.Builder
addAllModified(Iterable<String> elements)
Adds elements tomodified
list.ImmutablePushCommit.Builder
addAllRemoved(Iterable<String> elements)
Adds elements toremoved
list.ImmutablePushCommit.Builder
added(Iterable<String> elements)
Sets or replaces all elements foradded
list.ImmutablePushCommit.Builder
addModified(String element)
Adds one element tomodified
list.ImmutablePushCommit.Builder
addModified(String... elements)
Adds elements tomodified
list.ImmutablePushCommit.Builder
addRemoved(String element)
Adds one element toremoved
list.ImmutablePushCommit.Builder
addRemoved(String... elements)
Adds elements toremoved
list.ImmutablePushCommit.Builder
author(Author author)
Initializes the value for theauthor
attribute.ImmutablePushCommit
build()
Builds a newImmutablePushCommit
.ImmutablePushCommit.Builder
committer(Author committer)
Initializes the value for thecommitter
attribute.ImmutablePushCommit.Builder
distinct(Boolean distinct)
Initializes the value for thedistinct
attribute.ImmutablePushCommit.Builder
from(PushCommit instance)
Fill a builder with attribute values from the providedPushCommit
instance.ImmutablePushCommit.Builder
id(String id)
Initializes the value for theid
attribute.ImmutablePushCommit.Builder
message(String message)
Initializes the value for themessage
attribute.ImmutablePushCommit.Builder
modified(Iterable<String> elements)
Sets or replaces all elements formodified
list.ImmutablePushCommit.Builder
removed(Iterable<String> elements)
Sets or replaces all elements forremoved
list.ImmutablePushCommit.Builder
timestamp(ZonedDateTime timestamp)
Initializes the value for thetimestamp
attribute.ImmutablePushCommit.Builder
treeId(String treeId)
Initializes the value for thetreeId
attribute.ImmutablePushCommit.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder from(PushCommit instance)
Fill a builder with attribute values from the providedPushCommit
instance. 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:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder id(@Nullable String id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
treeId
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder treeId(@Nullable String treeId)
Initializes the value for thetreeId
attribute.- Parameters:
treeId
- The value for treeId (can benull
)- Returns:
this
builder for use in a chained invocation
-
distinct
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder distinct(@Nullable Boolean distinct)
Initializes the value for thedistinct
attribute.- Parameters:
distinct
- The value for distinct (can benull
)- Returns:
this
builder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder message(@Nullable String message)
Initializes the value for themessage
attribute.- Parameters:
message
- The value for message (can benull
)- Returns:
this
builder for use in a chained invocation
-
timestamp
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder timestamp(@Nullable ZonedDateTime timestamp)
Initializes the value for thetimestamp
attribute.- Parameters:
timestamp
- The value for timestamp (can benull
)- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder url(@Nullable URI url)
Initializes the value for theurl
attribute.- Parameters:
url
- The value for url (can benull
)- Returns:
this
builder for use in a chained invocation
-
author
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder author(@Nullable Author author)
Initializes the value for theauthor
attribute.- Parameters:
author
- The value for author (can benull
)- Returns:
this
builder for use in a chained invocation
-
committer
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder committer(@Nullable Author committer)
Initializes the value for thecommitter
attribute.- Parameters:
committer
- The value for committer (can benull
)- Returns:
this
builder for use in a chained invocation
-
addAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAdded(String element)
Adds one element toadded
list.- Parameters:
element
- A added element- Returns:
this
builder for use in a chained invocation
-
addAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAdded(String... elements)
Adds elements toadded
list.- Parameters:
elements
- An array of added elements- Returns:
this
builder for use in a chained invocation
-
added
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder added(@Nullable Iterable<String> elements)
Sets or replaces all elements foradded
list.- Parameters:
elements
- An iterable of added elements- Returns:
this
builder for use in a chained invocation
-
addAllAdded
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllAdded(Iterable<String> elements)
Adds elements toadded
list.- Parameters:
elements
- An iterable of added elements- Returns:
this
builder for use in a chained invocation
-
addRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addRemoved(String element)
Adds one element toremoved
list.- Parameters:
element
- A removed element- Returns:
this
builder for use in a chained invocation
-
addRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addRemoved(String... elements)
Adds elements toremoved
list.- Parameters:
elements
- An array of removed elements- Returns:
this
builder for use in a chained invocation
-
removed
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder removed(@Nullable Iterable<String> elements)
Sets or replaces all elements forremoved
list.- Parameters:
elements
- An iterable of removed elements- Returns:
this
builder for use in a chained invocation
-
addAllRemoved
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllRemoved(Iterable<String> elements)
Adds elements toremoved
list.- Parameters:
elements
- An iterable of removed elements- Returns:
this
builder for use in a chained invocation
-
addModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addModified(String element)
Adds one element tomodified
list.- Parameters:
element
- A modified element- Returns:
this
builder for use in a chained invocation
-
addModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addModified(String... elements)
Adds elements tomodified
list.- Parameters:
elements
- An array of modified elements- Returns:
this
builder for use in a chained invocation
-
modified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder modified(@Nullable Iterable<String> elements)
Sets or replaces all elements formodified
list.- Parameters:
elements
- An iterable of modified elements- Returns:
this
builder for use in a chained invocation
-
addAllModified
@CanIgnoreReturnValue public final ImmutablePushCommit.Builder addAllModified(Iterable<String> elements)
Adds elements tomodified
list.- Parameters:
elements
- An iterable of modified elements- Returns:
this
builder 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
-
-