Class ImmutablePullRequestParameters
- java.lang.Object
-
- com.spotify.github.v3.prs.requests.ImmutablePullRequestParameters
-
- All Implemented Interfaces:
Parameters
,PullRequestParameters
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePullRequestParameters extends Object implements PullRequestParameters
Immutable implementation ofPullRequestParameters
.Use the builder to create immutable instances:
ImmutablePullRequestParameters.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutablePullRequestParameters.Builder
Builds instances of typeImmutablePullRequestParameters
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
base()
Filter pulls by base branch name.static ImmutablePullRequestParameters.Builder
builder()
Creates a builder forImmutablePullRequestParameters
.static ImmutablePullRequestParameters
copyOf(PullRequestParameters instance)
Creates an immutable copy of aPullRequestParameters
value.Optional<String>
direction()
The direction of the sort.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePullRequestParameters
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:state
,head
,base
,sort
,direction
,per_page
,page
.Optional<String>
head()
Filter pulls by head user and branch name in the format of user:ref-name.Optional<Integer>
page()
Page number of the results to fetch.Optional<Integer>
per_page()
Results per page (max 100)Optional<String>
sort()
What to sort results by.Optional<String>
state()
Either open, closed, or all to filter by state.String
toString()
Prints the immutable valuePullRequestParameters
with attribute values.ImmutablePullRequestParameters
withBase(String value)
Copy the current immutable object by setting a present value for the optionalbase
attribute.ImmutablePullRequestParameters
withBase(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebase
attribute.ImmutablePullRequestParameters
withDirection(String value)
Copy the current immutable object by setting a present value for the optionaldirection
attribute.ImmutablePullRequestParameters
withDirection(Optional<String> optional)
Copy the current immutable object by setting an optional value for thedirection
attribute.ImmutablePullRequestParameters
withHead(String value)
Copy the current immutable object by setting a present value for the optionalhead
attribute.ImmutablePullRequestParameters
withHead(Optional<String> optional)
Copy the current immutable object by setting an optional value for thehead
attribute.ImmutablePullRequestParameters
withPage(int value)
Copy the current immutable object by setting a present value for the optionalpage
attribute.ImmutablePullRequestParameters
withPage(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for thepage
attribute.ImmutablePullRequestParameters
withPer_page(int value)
Copy the current immutable object by setting a present value for the optionalper_page
attribute.ImmutablePullRequestParameters
withPer_page(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theper_page
attribute.ImmutablePullRequestParameters
withSort(String value)
Copy the current immutable object by setting a present value for the optionalsort
attribute.ImmutablePullRequestParameters
withSort(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesort
attribute.ImmutablePullRequestParameters
withState(String value)
Copy the current immutable object by setting a present value for the optionalstate
attribute.ImmutablePullRequestParameters
withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestate
attribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.spotify.github.Parameters
serialize
-
-
-
-
Method Detail
-
state
public Optional<String> state()
Either open, closed, or all to filter by state. Default: open- Specified by:
state
in interfacePullRequestParameters
-
head
public Optional<String> head()
Filter pulls by head user and branch name in the format of user:ref-name. Example: github:new-script-format.- Specified by:
head
in interfacePullRequestParameters
-
base
public Optional<String> base()
Filter pulls by base branch name. Example: gh-pages.- Specified by:
base
in interfacePullRequestParameters
-
sort
public Optional<String> sort()
What to sort results by. Can be either created, updated, popularity (comment count) or long-running (age, filtering by pulls updated in the last month). Default: created- Specified by:
sort
in interfacePullRequestParameters
-
direction
public Optional<String> direction()
The direction of the sort. Can be either asc or desc. Default: desc when sort is created or sort is not specified, otherwise asc.- Specified by:
direction
in interfacePullRequestParameters
-
per_page
public Optional<Integer> per_page()
Results per page (max 100)- Specified by:
per_page
in interfacePullRequestParameters
-
page
public Optional<Integer> page()
Page number of the results to fetch.- Specified by:
page
in interfacePullRequestParameters
-
withState
public final ImmutablePullRequestParameters withState(String value)
Copy the current immutable object by setting a present value for the optionalstate
attribute.- Parameters:
value
- The value for state- Returns:
- A modified copy of
this
object
-
withState
public final ImmutablePullRequestParameters withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestate
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for state- Returns:
- A modified copy of
this
object
-
withHead
public final ImmutablePullRequestParameters withHead(String value)
Copy the current immutable object by setting a present value for the optionalhead
attribute.- Parameters:
value
- The value for head- Returns:
- A modified copy of
this
object
-
withHead
public final ImmutablePullRequestParameters withHead(Optional<String> optional)
Copy the current immutable object by setting an optional value for thehead
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for head- Returns:
- A modified copy of
this
object
-
withBase
public final ImmutablePullRequestParameters withBase(String value)
Copy the current immutable object by setting a present value for the optionalbase
attribute.- Parameters:
value
- The value for base- Returns:
- A modified copy of
this
object
-
withBase
public final ImmutablePullRequestParameters withBase(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebase
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for base- Returns:
- A modified copy of
this
object
-
withSort
public final ImmutablePullRequestParameters withSort(String value)
Copy the current immutable object by setting a present value for the optionalsort
attribute.- Parameters:
value
- The value for sort- Returns:
- A modified copy of
this
object
-
withSort
public final ImmutablePullRequestParameters withSort(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesort
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for sort- Returns:
- A modified copy of
this
object
-
withDirection
public final ImmutablePullRequestParameters withDirection(String value)
Copy the current immutable object by setting a present value for the optionaldirection
attribute.- Parameters:
value
- The value for direction- Returns:
- A modified copy of
this
object
-
withDirection
public final ImmutablePullRequestParameters withDirection(Optional<String> optional)
Copy the current immutable object by setting an optional value for thedirection
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for direction- Returns:
- A modified copy of
this
object
-
withPer_page
public final ImmutablePullRequestParameters withPer_page(int value)
Copy the current immutable object by setting a present value for the optionalper_page
attribute.- Parameters:
value
- The value for per_page- Returns:
- A modified copy of
this
object
-
withPer_page
public final ImmutablePullRequestParameters withPer_page(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theper_page
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for per_page- Returns:
- A modified copy of
this
object
-
withPage
public final ImmutablePullRequestParameters withPage(int value)
Copy the current immutable object by setting a present value for the optionalpage
attribute.- Parameters:
value
- The value for page- Returns:
- A modified copy of
this
object
-
withPage
public final ImmutablePullRequestParameters withPage(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for thepage
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for page- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePullRequestParameters
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:state
,head
,base
,sort
,direction
,per_page
,page
.
-
toString
public String toString()
Prints the immutable valuePullRequestParameters
with attribute values.
-
copyOf
public static ImmutablePullRequestParameters copyOf(PullRequestParameters instance)
Creates an immutable copy of aPullRequestParameters
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable PullRequestParameters instance
-
builder
public static ImmutablePullRequestParameters.Builder builder()
Creates a builder forImmutablePullRequestParameters
.ImmutablePullRequestParameters.builder() .state(String) // optional
state
.head(String) // optionalhead
.base(String) // optionalbase
.sort(String) // optionalsort
.direction(String) // optionaldirection
.per_page(Integer) // optionalper_page
.page(Integer) // optionalpage
.build();- Returns:
- A new ImmutablePullRequestParameters builder
-
-