Class ImmutablePullRequestCreate.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.requests.ImmutablePullRequestCreate.Builder
-
- Enclosing class:
- ImmutablePullRequestCreate
@NotThreadSafe public static final class ImmutablePullRequestCreate.Builder extends Object
Builds instances of typeImmutablePullRequestCreate
. 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 ImmutablePullRequestCreate.Builder
base(String base)
Initializes the value for thebase
attribute.ImmutablePullRequestCreate.Builder
body(String body)
Initializes the optional valuebody
to body.ImmutablePullRequestCreate.Builder
body(Optional<String> body)
Initializes the optional valuebody
to body.ImmutablePullRequestCreate
build()
Builds a newImmutablePullRequestCreate
.ImmutablePullRequestCreate.Builder
draft(Boolean draft)
Initializes the value for thedraft
attribute.ImmutablePullRequestCreate.Builder
from(PullRequestCreate instance)
Fill a builder with attribute values from the providedPullRequestCreate
instance.ImmutablePullRequestCreate.Builder
head(String head)
Initializes the value for thehead
attribute.ImmutablePullRequestCreate.Builder
title(String title)
Initializes the value for thetitle
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder from(PullRequestCreate instance)
Fill a builder with attribute values from the providedPullRequestCreate
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
-
title
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder title(@Nullable String title)
Initializes the value for thetitle
attribute.- Parameters:
title
- The value for title (can benull
)- Returns:
this
builder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder body(String body)
Initializes the optional valuebody
to body.- Parameters:
body
- The value for body- Returns:
this
builder for chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder body(Optional<String> body)
Initializes the optional valuebody
to body.- Parameters:
body
- The value for body- Returns:
this
builder for use in a chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder head(@Nullable String head)
Initializes the value for thehead
attribute.- Parameters:
head
- The value for head (can benull
)- Returns:
this
builder for use in a chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder base(@Nullable String base)
Initializes the value for thebase
attribute.- Parameters:
base
- The value for base (can benull
)- Returns:
this
builder for use in a chained invocation
-
draft
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder draft(@Nullable Boolean draft)
Initializes the value for thedraft
attribute.- Parameters:
draft
- The value for draft (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutablePullRequestCreate build()
Builds a newImmutablePullRequestCreate
.- Returns:
- An immutable instance of PullRequestCreate
- Throws:
IllegalStateException
- if any required attributes are missing
-
-