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 class
ImmutableSearchParameters.Builder
Builds instances of typeImmutableSearchParameters
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSearchParameters.Builder
builder()
Creates a builder forImmutableSearchParameters
.static ImmutableSearchParameters
copyOf(SearchParameters instance)
Creates an immutable copy of aSearchParameters
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableSearchParameters
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:q
,sort
,order
.Optional<String>
order()
The sort order if sort parameter is provided.String
q()
The search keywords, as well as any qualifiers.Optional<String>
sort()
The sort field.String
toString()
Prints the immutable valueSearchParameters
with attribute values.ImmutableSearchParameters
withOrder(String value)
Copy the current immutable object by setting a present value for the optionalorder
attribute.ImmutableSearchParameters
withOrder(Optional<String> optional)
Copy the current immutable object by setting an optional value for theorder
attribute.ImmutableSearchParameters
withQ(String value)
Copy the current immutable object by setting a value for theq
attribute.ImmutableSearchParameters
withSort(String value)
Copy the current immutable object by setting a present value for the optionalsort
attribute.ImmutableSearchParameters
withSort(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesort
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
-
q
@Nullable public String q()
The search keywords, as well as any qualifiers.- Specified by:
q
in interfaceSearchParameters
-
sort
public Optional<String> sort()
The sort field. One of stars, forks, or updated. Default: results are sorted by best match.- Specified by:
sort
in interfaceSearchParameters
-
order
public Optional<String> order()
The sort order if sort parameter is provided. One of asc or desc. Default: desc- Specified by:
order
in interfaceSearchParameters
-
withQ
public final ImmutableSearchParameters withQ(@Nullable String value)
Copy the current immutable object by setting a value for theq
attribute. 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
this
object
-
withSort
public final ImmutableSearchParameters 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 ImmutableSearchParameters 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
-
withOrder
public final ImmutableSearchParameters withOrder(String value)
Copy the current immutable object by setting a present value for the optionalorder
attribute.- Parameters:
value
- The value for order- Returns:
- A modified copy of
this
object
-
withOrder
public final ImmutableSearchParameters withOrder(Optional<String> optional)
Copy the current immutable object by setting an optional value for theorder
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableSearchParameters
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:q
,sort
,order
.
-
toString
public String toString()
Prints the immutable valueSearchParameters
with attribute values.
-
copyOf
public static ImmutableSearchParameters copyOf(SearchParameters instance)
Creates an immutable copy of aSearchParameters
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 SearchParameters instance
-
builder
public static ImmutableSearchParameters.Builder builder()
Creates a builder forImmutableSearchParameters
.ImmutableSearchParameters.builder() .q(String | null) // nullable
q
.sort(String) // optionalsort
.order(String) // optionalorder
.build();- Returns:
- A new ImmutableSearchParameters builder
-
-