Package com.spotify.github.v3.prs
Class ImmutablePullRequestRef.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.ImmutablePullRequestRef.Builder
-
- Enclosing class:
- ImmutablePullRequestRef
@NotThreadSafe public static final class ImmutablePullRequestRef.Builder extends Object
Builds instances of typeImmutablePullRequestRef
. 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 ImmutablePullRequestRef
build()
Builds a newImmutablePullRequestRef
.ImmutablePullRequestRef.Builder
from(PullRequestRef instance)
Fill a builder with attribute values from the providedPullRequestRef
instance.ImmutablePullRequestRef.Builder
label(String label)
Initializes the optional valuelabel
to label.ImmutablePullRequestRef.Builder
label(Optional<String> label)
Initializes the optional valuelabel
to label.ImmutablePullRequestRef.Builder
ref(String ref)
Initializes the value for theref
attribute.ImmutablePullRequestRef.Builder
repo(Repository repo)
Initializes the optional valuerepo
to repo.ImmutablePullRequestRef.Builder
repo(Optional<? extends Repository> repo)
Initializes the optional valuerepo
to repo.ImmutablePullRequestRef.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutablePullRequestRef.Builder
user(User user)
Initializes the optional valueuser
to user.ImmutablePullRequestRef.Builder
user(Optional<? extends User> user)
Initializes the optional valueuser
to user.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder from(PullRequestRef instance)
Fill a builder with attribute values from the providedPullRequestRef
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
-
label
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder label(String label)
Initializes the optional valuelabel
to label.- Parameters:
label
- The value for label- Returns:
this
builder for chained invocation
-
label
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder label(Optional<String> label)
Initializes the optional valuelabel
to label.- Parameters:
label
- The value for label- Returns:
this
builder for use in a chained invocation
-
ref
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder ref(@Nullable String ref)
Initializes the value for theref
attribute.- Parameters:
ref
- The value for ref (can benull
)- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder sha(@Nullable String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha (can benull
)- Returns:
this
builder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder user(User user)
Initializes the optional valueuser
to user.- Parameters:
user
- The value for user- Returns:
this
builder for chained invocation
-
user
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder user(Optional<? extends User> user)
Initializes the optional valueuser
to user.- Parameters:
user
- The value for user- Returns:
this
builder for use in a chained invocation
-
repo
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder repo(Repository repo)
Initializes the optional valuerepo
to repo.- Parameters:
repo
- The value for repo- Returns:
this
builder for chained invocation
-
repo
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder repo(Optional<? extends Repository> repo)
Initializes the optional valuerepo
to repo.- Parameters:
repo
- The value for repo- Returns:
this
builder for use in a chained invocation
-
build
public ImmutablePullRequestRef build()
Builds a newImmutablePullRequestRef
.- Returns:
- An immutable instance of PullRequestRef
- Throws:
IllegalStateException
- if any required attributes are missing
-
-