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 classImmutablePullRequestParameters.BuilderBuilds 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.Builderbuilder()Creates a builder forImmutablePullRequestParameters.static ImmutablePullRequestParameterscopyOf(PullRequestParameters instance)Creates an immutable copy of aPullRequestParametersvalue.Optional<String>direction()The direction of the sort.booleanequals(Object another)This instance is equal to all instances ofImmutablePullRequestParametersthat have equal attribute values.inthashCode()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.StringtoString()Prints the immutable valuePullRequestParameterswith attribute values.ImmutablePullRequestParameterswithBase(String value)Copy the current immutable object by setting a present value for the optionalbaseattribute.ImmutablePullRequestParameterswithBase(Optional<String> optional)Copy the current immutable object by setting an optional value for thebaseattribute.ImmutablePullRequestParameterswithDirection(String value)Copy the current immutable object by setting a present value for the optionaldirectionattribute.ImmutablePullRequestParameterswithDirection(Optional<String> optional)Copy the current immutable object by setting an optional value for thedirectionattribute.ImmutablePullRequestParameterswithHead(String value)Copy the current immutable object by setting a present value for the optionalheadattribute.ImmutablePullRequestParameterswithHead(Optional<String> optional)Copy the current immutable object by setting an optional value for theheadattribute.ImmutablePullRequestParameterswithPage(int value)Copy the current immutable object by setting a present value for the optionalpageattribute.ImmutablePullRequestParameterswithPage(Optional<Integer> optional)Copy the current immutable object by setting an optional value for thepageattribute.ImmutablePullRequestParameterswithPer_page(int value)Copy the current immutable object by setting a present value for the optionalper_pageattribute.ImmutablePullRequestParameterswithPer_page(Optional<Integer> optional)Copy the current immutable object by setting an optional value for theper_pageattribute.ImmutablePullRequestParameterswithSort(String value)Copy the current immutable object by setting a present value for the optionalsortattribute.ImmutablePullRequestParameterswithSort(Optional<String> optional)Copy the current immutable object by setting an optional value for thesortattribute.ImmutablePullRequestParameterswithState(String value)Copy the current immutable object by setting a present value for the optionalstateattribute.ImmutablePullRequestParameterswithState(Optional<String> optional)Copy the current immutable object by setting an optional value for thestateattribute.-
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:
statein 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:
headin interfacePullRequestParameters
-
base
public Optional<String> base()
Filter pulls by base branch name. Example: gh-pages.- Specified by:
basein 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:
sortin 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:
directionin interfacePullRequestParameters
-
per_page
public Optional<Integer> per_page()
Results per page (max 100)- Specified by:
per_pagein interfacePullRequestParameters
-
page
public Optional<Integer> page()
Page number of the results to fetch.- Specified by:
pagein interfacePullRequestParameters
-
withState
public final ImmutablePullRequestParameters withState(String value)
Copy the current immutable object by setting a present value for the optionalstateattribute.- Parameters:
value- The value for state- Returns:
- A modified copy of
thisobject
-
withState
public final ImmutablePullRequestParameters withState(Optional<String> optional)
Copy the current immutable object by setting an optional value for thestateattribute. 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
thisobject
-
withHead
public final ImmutablePullRequestParameters withHead(String value)
Copy the current immutable object by setting a present value for the optionalheadattribute.- Parameters:
value- The value for head- Returns:
- A modified copy of
thisobject
-
withHead
public final ImmutablePullRequestParameters withHead(Optional<String> optional)
Copy the current immutable object by setting an optional value for theheadattribute. 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
thisobject
-
withBase
public final ImmutablePullRequestParameters withBase(String value)
Copy the current immutable object by setting a present value for the optionalbaseattribute.- Parameters:
value- The value for base- Returns:
- A modified copy of
thisobject
-
withBase
public final ImmutablePullRequestParameters withBase(Optional<String> optional)
Copy the current immutable object by setting an optional value for thebaseattribute. 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
thisobject
-
withSort
public final ImmutablePullRequestParameters withSort(String value)
Copy the current immutable object by setting a present value for the optionalsortattribute.- Parameters:
value- The value for sort- Returns:
- A modified copy of
thisobject
-
withSort
public final ImmutablePullRequestParameters withSort(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesortattribute. 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
thisobject
-
withDirection
public final ImmutablePullRequestParameters withDirection(String value)
Copy the current immutable object by setting a present value for the optionaldirectionattribute.- Parameters:
value- The value for direction- Returns:
- A modified copy of
thisobject
-
withDirection
public final ImmutablePullRequestParameters withDirection(Optional<String> optional)
Copy the current immutable object by setting an optional value for thedirectionattribute. 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
thisobject
-
withPer_page
public final ImmutablePullRequestParameters withPer_page(int value)
Copy the current immutable object by setting a present value for the optionalper_pageattribute.- Parameters:
value- The value for per_page- Returns:
- A modified copy of
thisobject
-
withPer_page
public final ImmutablePullRequestParameters withPer_page(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theper_pageattribute. 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
thisobject
-
withPage
public final ImmutablePullRequestParameters withPage(int value)
Copy the current immutable object by setting a present value for the optionalpageattribute.- Parameters:
value- The value for page- Returns:
- A modified copy of
thisobject
-
withPage
public final ImmutablePullRequestParameters withPage(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for thepageattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePullRequestParametersthat 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 valuePullRequestParameterswith attribute values.
-
copyOf
public static ImmutablePullRequestParameters copyOf(PullRequestParameters instance)
Creates an immutable copy of aPullRequestParametersvalue. 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) // optionalstate.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
-
-