Package com.spotify.github.v3.prs
Class ImmutableReview.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutableReview.Builder
-
- Enclosing class:
- ImmutableReview
@NotThreadSafe public static final class ImmutableReview.Builder extends Object
Builds instances of typeImmutableReview. 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 ImmutableReview.Builderbody(String body)Initializes the optional valuebodyto body.ImmutableReview.Builderbody(Optional<String> body)Initializes the optional valuebodyto body.ImmutableReviewbuild()Builds a newImmutableReview.ImmutableReview.BuildercommitId(String commitId)Initializes the value for thecommitIdattribute.ImmutableReview.Builderfrom(Review instance)Fill a builder with attribute values from the providedReviewinstance.ImmutableReview.BuilderhtmlUrl(URI htmlUrl)Initializes the value for thehtmlUrlattribute.ImmutableReview.Builderid(Integer id)Initializes the value for theidattribute.ImmutableReview.Builderlinks(ReviewLinks links)Initializes the value for thelinksattribute.ImmutableReview.BuilderpullRequestUrl(URI pullRequestUrl)Initializes the value for thepullRequestUrlattribute.ImmutableReview.Builderstate(String state)Initializes the value for thestateattribute.ImmutableReview.BuildersubmittedAt(GitHubInstant submittedAt)Initializes the optional valuesubmittedAtto submittedAt.ImmutableReview.BuildersubmittedAt(Optional<? extends GitHubInstant> submittedAt)Initializes the optional valuesubmittedAtto submittedAt.ImmutableReview.Builderuser(User user)Initializes the value for theuserattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableReview.Builder from(Review instance)
Fill a builder with attribute values from the providedReviewinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableReview.Builder id(@Nullable Integer id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutableReview.Builder user(@Nullable User user)
Initializes the value for theuserattribute.- Parameters:
user- The value for user (can benull)- Returns:
thisbuilder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutableReview.Builder body(String body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for chained invocation
-
body
@CanIgnoreReturnValue public final ImmutableReview.Builder body(Optional<String> body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for use in a chained invocation
-
submittedAt
@CanIgnoreReturnValue public final ImmutableReview.Builder submittedAt(GitHubInstant submittedAt)
Initializes the optional valuesubmittedAtto submittedAt.- Parameters:
submittedAt- The value for submittedAt- Returns:
thisbuilder for chained invocation
-
submittedAt
@CanIgnoreReturnValue public final ImmutableReview.Builder submittedAt(Optional<? extends GitHubInstant> submittedAt)
Initializes the optional valuesubmittedAtto submittedAt.- Parameters:
submittedAt- The value for submittedAt- Returns:
thisbuilder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutableReview.Builder state(@Nullable String state)
Initializes the value for thestateattribute.- Parameters:
state- The value for state (can benull)- Returns:
thisbuilder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableReview.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
-
pullRequestUrl
@CanIgnoreReturnValue public final ImmutableReview.Builder pullRequestUrl(@Nullable URI pullRequestUrl)
Initializes the value for thepullRequestUrlattribute.- Parameters:
pullRequestUrl- The value for pullRequestUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutableReview.Builder links(@Nullable ReviewLinks links)
Initializes the value for thelinksattribute.- Parameters:
links- The value for links (can benull)- Returns:
thisbuilder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableReview.Builder commitId(@Nullable String commitId)
Initializes the value for thecommitIdattribute.- Parameters:
commitId- The value for commitId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableReview build()
Builds a newImmutableReview.- Returns:
- An immutable instance of Review
- Throws:
IllegalStateException- if any required attributes are missing
-
-