Class ImmutableSearchParameters
- java.lang.Object
-
- com.spotify.github.v3.search.requests.ImmutableSearchParameters
-
- All Implemented Interfaces:
Parameters,SearchParameters
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableSearchParameters extends Object implements SearchParameters
Immutable implementation ofSearchParameters.Use the builder to create immutable instances:
ImmutableSearchParameters.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableSearchParameters.BuilderBuilds instances of typeImmutableSearchParameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSearchParameters.Builderbuilder()Creates a builder forImmutableSearchParameters.static ImmutableSearchParameterscopyOf(SearchParameters instance)Creates an immutable copy of aSearchParametersvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableSearchParametersthat have equal attribute values.inthashCode()Computes a hash code from attributes:q,sort,order,per_page,page.Optional<String>order()The sort order if sort parameter is provided.Optional<Integer>page()Page number of the results to fetch.Optional<Integer>per_page()The number of results per page (max 100).Stringq()The search keywords, as well as any qualifiers.Optional<String>sort()The sort field.StringtoString()Prints the immutable valueSearchParameterswith attribute values.ImmutableSearchParameterswithOrder(String value)Copy the current immutable object by setting a present value for the optionalorderattribute.ImmutableSearchParameterswithOrder(Optional<String> optional)Copy the current immutable object by setting an optional value for theorderattribute.ImmutableSearchParameterswithPage(int value)Copy the current immutable object by setting a present value for the optionalpageattribute.ImmutableSearchParameterswithPage(Optional<Integer> optional)Copy the current immutable object by setting an optional value for thepageattribute.ImmutableSearchParameterswithPer_page(int value)Copy the current immutable object by setting a present value for the optionalper_pageattribute.ImmutableSearchParameterswithPer_page(Optional<Integer> optional)Copy the current immutable object by setting an optional value for theper_pageattribute.ImmutableSearchParameterswithQ(String value)Copy the current immutable object by setting a value for theqattribute.ImmutableSearchParameterswithSort(String value)Copy the current immutable object by setting a present value for the optionalsortattribute.ImmutableSearchParameterswithSort(Optional<String> optional)Copy the current immutable object by setting an optional value for thesortattribute.-
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
-
q
@Nullable public String q()
The search keywords, as well as any qualifiers.- Specified by:
qin interfaceSearchParameters
-
sort
public Optional<String> sort()
The sort field. One of stars, forks, or updated. Default: results are sorted by best match.- Specified by:
sortin interfaceSearchParameters
-
order
public Optional<String> order()
The sort order if sort parameter is provided. One of asc or desc. Default: desc- Specified by:
orderin interfaceSearchParameters
-
per_page
public Optional<Integer> per_page()
The number of results per page (max 100). Default: 30- Specified by:
per_pagein interfaceSearchParameters
-
page
public Optional<Integer> page()
Page number of the results to fetch. Default: 1- Specified by:
pagein interfaceSearchParameters
-
withQ
public final ImmutableSearchParameters withQ(@Nullable String value)
Copy the current immutable object by setting a value for theqattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for q (can benull)- Returns:
- A modified copy of the
thisobject
-
withSort
public final ImmutableSearchParameters 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 ImmutableSearchParameters 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
-
withOrder
public final ImmutableSearchParameters withOrder(String value)
Copy the current immutable object by setting a present value for the optionalorderattribute.- Parameters:
value- The value for order- Returns:
- A modified copy of
thisobject
-
withOrder
public final ImmutableSearchParameters withOrder(Optional<String> optional)
Copy the current immutable object by setting an optional value for theorderattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for order- Returns:
- A modified copy of
thisobject
-
withPer_page
public final ImmutableSearchParameters 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 ImmutableSearchParameters 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 ImmutableSearchParameters 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 ImmutableSearchParameters 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 ofImmutableSearchParametersthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:q,sort,order,per_page,page.
-
toString
public String toString()
Prints the immutable valueSearchParameterswith attribute values.
-
copyOf
public static ImmutableSearchParameters copyOf(SearchParameters instance)
Creates an immutable copy of aSearchParametersvalue. 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 SearchParameters instance
-
builder
public static ImmutableSearchParameters.Builder builder()
Creates a builder forImmutableSearchParameters.ImmutableSearchParameters.builder() .q(String | null) // nullableq.sort(String) // optionalsort.order(String) // optionalorder.per_page(Integer) // optionalper_page.page(Integer) // optionalpage.build();- Returns:
- A new ImmutableSearchParameters builder
-
-