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.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 ImmutablePullRequestRefbuild()Builds a newImmutablePullRequestRef.ImmutablePullRequestRef.Builderfrom(PullRequestRef instance)Fill a builder with attribute values from the providedPullRequestRefinstance.ImmutablePullRequestRef.Builderlabel(String label)Initializes the optional valuelabelto label.ImmutablePullRequestRef.Builderlabel(Optional<String> label)Initializes the optional valuelabelto label.ImmutablePullRequestRef.Builderref(String ref)Initializes the value for therefattribute.ImmutablePullRequestRef.Builderrepo(Repository repo)Initializes the optional valuerepoto repo.ImmutablePullRequestRef.Builderrepo(Optional<? extends Repository> repo)Initializes the optional valuerepoto repo.ImmutablePullRequestRef.Buildersha(String sha)Initializes the value for theshaattribute.ImmutablePullRequestRef.Builderuser(User user)Initializes the optional valueuserto user.ImmutablePullRequestRef.Builderuser(Optional<? extends User> user)Initializes the optional valueuserto user.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder from(PullRequestRef instance)
Fill a builder with attribute values from the providedPullRequestRefinstance. 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
-
label
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder label(String label)
Initializes the optional valuelabelto label.- Parameters:
label- The value for label- Returns:
thisbuilder for chained invocation
-
label
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder label(Optional<String> label)
Initializes the optional valuelabelto label.- Parameters:
label- The value for label- Returns:
thisbuilder for use in a chained invocation
-
ref
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder ref(@Nullable String ref)
Initializes the value for therefattribute.- Parameters:
ref- The value for ref (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder sha(@Nullable String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha (can benull)- Returns:
thisbuilder for use in a chained invocation
-
user
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder user(User user)
Initializes the optional valueuserto user.- Parameters:
user- The value for user- Returns:
thisbuilder for chained invocation
-
user
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder user(Optional<? extends User> user)
Initializes the optional valueuserto user.- Parameters:
user- The value for user- Returns:
thisbuilder for use in a chained invocation
-
repo
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder repo(Repository repo)
Initializes the optional valuerepoto repo.- Parameters:
repo- The value for repo- Returns:
thisbuilder for chained invocation
-
repo
@CanIgnoreReturnValue public final ImmutablePullRequestRef.Builder repo(Optional<? extends Repository> repo)
Initializes the optional valuerepoto repo.- Parameters:
repo- The value for repo- Returns:
thisbuilder 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
-
-