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.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 ImmutablePullRequestCreate.Builderbase(String base)Initializes the value for thebaseattribute.ImmutablePullRequestCreate.Builderbody(String body)Initializes the optional valuebodyto body.ImmutablePullRequestCreate.Builderbody(Optional<String> body)Initializes the optional valuebodyto body.ImmutablePullRequestCreatebuild()Builds a newImmutablePullRequestCreate.ImmutablePullRequestCreate.Builderdraft(Boolean draft)Initializes the value for thedraftattribute.ImmutablePullRequestCreate.Builderfrom(PullRequestCreate instance)Fill a builder with attribute values from the providedPullRequestCreateinstance.ImmutablePullRequestCreate.Builderhead(String head)Initializes the value for theheadattribute.ImmutablePullRequestCreate.Buildertitle(String title)Initializes the value for thetitleattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder from(PullRequestCreate instance)
Fill a builder with attribute values from the providedPullRequestCreateinstance. 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
-
title
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder title(@Nullable String title)
Initializes the value for thetitleattribute.- Parameters:
title- The value for title (can benull)- Returns:
thisbuilder for use in a chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder body(String body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for chained invocation
-
body
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder body(Optional<String> body)
Initializes the optional valuebodyto body.- Parameters:
body- The value for body- Returns:
thisbuilder for use in a chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder head(@Nullable String head)
Initializes the value for theheadattribute.- Parameters:
head- The value for head (can benull)- Returns:
thisbuilder for use in a chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder base(@Nullable String base)
Initializes the value for thebaseattribute.- Parameters:
base- The value for base (can benull)- Returns:
thisbuilder for use in a chained invocation
-
draft
@CanIgnoreReturnValue public final ImmutablePullRequestCreate.Builder draft(@Nullable Boolean draft)
Initializes the value for thedraftattribute.- Parameters:
draft- The value for draft (can benull)- Returns:
thisbuilder 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
-
-