Class ImmutablePullRequestParameters.Builder
- java.lang.Object
-
- com.spotify.github.v3.prs.requests.ImmutablePullRequestParameters.Builder
-
- Enclosing class:
- ImmutablePullRequestParameters
@NotThreadSafe public static final class ImmutablePullRequestParameters.Builder extends Object
Builds instances of typeImmutablePullRequestParameters
. 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
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder from(PullRequestParameters instance)
Fill a builder with attribute values from the providedPullRequestParameters
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
-
state
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder state(String state)
Initializes the optional valuestate
to state.- Parameters:
state
- The value for state- Returns:
this
builder for chained invocation
-
state
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder state(Optional<String> state)
Initializes the optional valuestate
to state.- Parameters:
state
- The value for state- Returns:
this
builder for use in a chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder head(String head)
Initializes the optional valuehead
to head.- Parameters:
head
- The value for head- Returns:
this
builder for chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder head(Optional<String> head)
Initializes the optional valuehead
to head.- Parameters:
head
- The value for head- Returns:
this
builder for use in a chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder base(String base)
Initializes the optional valuebase
to base.- Parameters:
base
- The value for base- Returns:
this
builder for chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder base(Optional<String> base)
Initializes the optional valuebase
to base.- Parameters:
base
- The value for base- Returns:
this
builder for use in a chained invocation
-
sort
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder sort(String sort)
Initializes the optional valuesort
to sort.- Parameters:
sort
- The value for sort- Returns:
this
builder for chained invocation
-
sort
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder sort(Optional<String> sort)
Initializes the optional valuesort
to sort.- Parameters:
sort
- The value for sort- Returns:
this
builder for use in a chained invocation
-
direction
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder direction(String direction)
Initializes the optional valuedirection
to direction.- Parameters:
direction
- The value for direction- Returns:
this
builder for chained invocation
-
direction
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder direction(Optional<String> direction)
Initializes the optional valuedirection
to direction.- Parameters:
direction
- The value for direction- Returns:
this
builder for use in a chained invocation
-
per_page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder per_page(int per_page)
Initializes the optional valueper_page
to per_page.- Parameters:
per_page
- The value for per_page- Returns:
this
builder for chained invocation
-
per_page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder per_page(Optional<Integer> per_page)
Initializes the optional valueper_page
to per_page.- Parameters:
per_page
- The value for per_page- Returns:
this
builder for use in a chained invocation
-
page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder page(int page)
Initializes the optional valuepage
to page.- Parameters:
page
- The value for page- Returns:
this
builder for chained invocation
-
page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder page(Optional<Integer> page)
Initializes the optional valuepage
to page.- Parameters:
page
- The value for page- Returns:
this
builder for use in a chained invocation
-
build
public ImmutablePullRequestParameters build()
Builds a newImmutablePullRequestParameters
.- Returns:
- An immutable instance of PullRequestParameters
- Throws:
IllegalStateException
- if any required attributes are missing
-
-