Package com.spotify.github.v3.repos
Class ImmutableCommitItem.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableCommitItem.Builder
-
- Enclosing class:
- ImmutableCommitItem
@NotThreadSafe public static final class ImmutableCommitItem.Builder extends Object
Builds instances of typeImmutableCommitItem. 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 ImmutableCommitItem.BuilderaddAllParents(Iterable<? extends ShaLink> elements)Adds elements toparentslist.ImmutableCommitItem.BuilderaddParents(ShaLink element)Adds one element toparentslist.ImmutableCommitItem.BuilderaddParents(ShaLink... elements)Adds elements toparentslist.ImmutableCommitItem.Builderauthor(User author)Initializes the optional valueauthorto author.ImmutableCommitItem.Builderauthor(Optional<? extends User> author)Initializes the optional valueauthorto author.ImmutableCommitItembuild()Builds a newImmutableCommitItem.ImmutableCommitItem.BuildercommentsUrl(URI commentsUrl)Initializes the value for thecommentsUrlattribute.ImmutableCommitItem.Buildercommit(Commit commit)Initializes the value for thecommitattribute.ImmutableCommitItem.Builderfrom(ShaLink instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLinkinstance.ImmutableCommitItem.Builderfrom(CommitItem instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.CommitIteminstance.ImmutableCommitItem.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableCommitItem.Builderparents(Iterable<? extends ShaLink> elements)Sets or replaces all elements forparentslist.ImmutableCommitItem.Buildersha(String sha)Initializes the value for theshaattribute.ImmutableCommitItem.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder from(ShaLink instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLinkinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder from(CommitItem instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.CommitIteminstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder sha(@Nullable String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableCommitItem.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
-
commit
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder commit(@Nullable Commit commit)
Initializes the value for thecommitattribute.- Parameters:
commit- The value for commit (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrlattribute.- Parameters:
htmlUrl- The value for htmlUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commentsUrl
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder commentsUrl(@Nullable URI commentsUrl)
Initializes the value for thecommentsUrlattribute.- Parameters:
commentsUrl- The value for commentsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
author
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder author(User author)
Initializes the optional valueauthorto author.- Parameters:
author- The value for author- Returns:
thisbuilder for chained invocation
-
author
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder author(Optional<? extends User> author)
Initializes the optional valueauthorto author.- Parameters:
author- The value for author- Returns:
thisbuilder for use in a chained invocation
-
addParents
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder addParents(ShaLink element)
Adds one element toparentslist.- Parameters:
element- A parents element- Returns:
thisbuilder for use in a chained invocation
-
addParents
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder addParents(ShaLink... elements)
Adds elements toparentslist.- Parameters:
elements- An array of parents elements- Returns:
thisbuilder for use in a chained invocation
-
parents
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder parents(@Nullable Iterable<? extends ShaLink> elements)
Sets or replaces all elements forparentslist.- Parameters:
elements- An iterable of parents elements- Returns:
thisbuilder for use in a chained invocation
-
addAllParents
@CanIgnoreReturnValue public final ImmutableCommitItem.Builder addAllParents(Iterable<? extends ShaLink> elements)
Adds elements toparentslist.- Parameters:
elements- An iterable of parents elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCommitItem build()
Builds a newImmutableCommitItem.- Returns:
- An immutable instance of CommitItem
- Throws:
IllegalStateException- if any required attributes are missing
-
-