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.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 ImmutableReview.Builder
body(Optional<String> body)
Initializes the value for thebody
attribute.ImmutableReview
build()
Builds a newImmutableReview
.ImmutableReview.Builder
commitId(String commitId)
Initializes the value for thecommitId
attribute.ImmutableReview.Builder
from(Review instance)
Fill a builder with attribute values from the providedReview
instance.ImmutableReview.Builder
htmlUrl(URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.ImmutableReview.Builder
id(Integer id)
Initializes the value for theid
attribute.ImmutableReview.Builder
links(ReviewLinks links)
Initializes the value for thelinks
attribute.ImmutableReview.Builder
pullRequestUrl(URI pullRequestUrl)
Initializes the value for thepullRequestUrl
attribute.ImmutableReview.Builder
state(String state)
Initializes the value for thestate
attribute.ImmutableReview.Builder
submittedAt(GitHubInstant submittedAt)
Initializes the optional valuesubmittedAt
to submittedAt.ImmutableReview.Builder
submittedAt(Optional<? extends GitHubInstant> submittedAt)
Initializes the optional valuesubmittedAt
to submittedAt.ImmutableReview.Builder
user(User user)
Initializes the value for theuser
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableReview.Builder from(Review instance)
Fill a builder with attribute values from the providedReview
instance. 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:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableReview.Builder id(@Nullable Integer id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutableReview.Builder user(@Nullable User user)
Initializes the value for theuser
attribute.- Parameters:
user
- The value for user (can benull
)- Returns:
this
builder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutableReview.Builder body(@Nullable Optional<String> body)
Initializes the value for thebody
attribute.- Parameters:
body
- The value for body (can benull
)- Returns:
this
builder for use in a chained invocation
-
submittedAt
@CanIgnoreReturnValue public final ImmutableReview.Builder submittedAt(GitHubInstant submittedAt)
Initializes the optional valuesubmittedAt
to submittedAt.- Parameters:
submittedAt
- The value for submittedAt- Returns:
this
builder for chained invocation
-
submittedAt
@CanIgnoreReturnValue public final ImmutableReview.Builder submittedAt(Optional<? extends GitHubInstant> submittedAt)
Initializes the optional valuesubmittedAt
to submittedAt.- Parameters:
submittedAt
- The value for submittedAt- Returns:
this
builder for use in a chained invocation
-
state
@CanIgnoreReturnValue public final ImmutableReview.Builder state(@Nullable String state)
Initializes the value for thestate
attribute.- Parameters:
state
- The value for state (can benull
)- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableReview.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.- Parameters:
htmlUrl
- The value for htmlUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
pullRequestUrl
@CanIgnoreReturnValue public final ImmutableReview.Builder pullRequestUrl(@Nullable URI pullRequestUrl)
Initializes the value for thepullRequestUrl
attribute.- Parameters:
pullRequestUrl
- The value for pullRequestUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
links
@CanIgnoreReturnValue public final ImmutableReview.Builder links(@Nullable ReviewLinks links)
Initializes the value for thelinks
attribute.- Parameters:
links
- The value for links (can benull
)- Returns:
this
builder for use in a chained invocation
-
commitId
@CanIgnoreReturnValue public final ImmutableReview.Builder commitId(@Nullable String commitId)
Initializes the value for thecommitId
attribute.- Parameters:
commitId
- The value for commitId (can benull
)- Returns:
this
builder 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
-
-