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.Builderis 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 providedPullRequestParametersinstance. 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
-
state
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder state(String state)
Initializes the optional valuestateto state.- Parameters:
state- The value for state- Returns:
thisbuilder for chained invocation
-
state
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder state(Optional<String> state)
Initializes the optional valuestateto state.- Parameters:
state- The value for state- Returns:
thisbuilder for use in a chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder head(String head)
Initializes the optional valueheadto head.- Parameters:
head- The value for head- Returns:
thisbuilder for chained invocation
-
head
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder head(Optional<String> head)
Initializes the optional valueheadto head.- Parameters:
head- The value for head- Returns:
thisbuilder for use in a chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder base(String base)
Initializes the optional valuebaseto base.- Parameters:
base- The value for base- Returns:
thisbuilder for chained invocation
-
base
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder base(Optional<String> base)
Initializes the optional valuebaseto base.- Parameters:
base- The value for base- Returns:
thisbuilder for use in a chained invocation
-
sort
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder sort(String sort)
Initializes the optional valuesortto sort.- Parameters:
sort- The value for sort- Returns:
thisbuilder for chained invocation
-
sort
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder sort(Optional<String> sort)
Initializes the optional valuesortto sort.- Parameters:
sort- The value for sort- Returns:
thisbuilder for use in a chained invocation
-
direction
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder direction(String direction)
Initializes the optional valuedirectionto direction.- Parameters:
direction- The value for direction- Returns:
thisbuilder for chained invocation
-
direction
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder direction(Optional<String> direction)
Initializes the optional valuedirectionto direction.- Parameters:
direction- The value for direction- Returns:
thisbuilder for use in a chained invocation
-
per_page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder per_page(int per_page)
Initializes the optional valueper_pageto per_page.- Parameters:
per_page- The value for per_page- Returns:
thisbuilder for chained invocation
-
per_page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder per_page(Optional<Integer> per_page)
Initializes the optional valueper_pageto per_page.- Parameters:
per_page- The value for per_page- Returns:
thisbuilder for use in a chained invocation
-
page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder page(int page)
Initializes the optional valuepageto page.- Parameters:
page- The value for page- Returns:
thisbuilder for chained invocation
-
page
@CanIgnoreReturnValue public final ImmutablePullRequestParameters.Builder page(Optional<Integer> page)
Initializes the optional valuepageto page.- Parameters:
page- The value for page- Returns:
thisbuilder 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
-
-