Package io.lettuce.core
Class GeoArgs
- java.lang.Object
-
- io.lettuce.core.GeoArgs
-
- All Implemented Interfaces:
CompositeArgument
public class GeoArgs extends Object implements CompositeArgument
Argument list builder for the Redis GEORADIUS and GEORADIUSBYMEMBER commands.GeoArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeoArgs.Builder
Builder entry points forGeoArgs
.static class
GeoArgs.Sort
Sort order.static class
GeoArgs.Unit
Supported geo unit.
-
Constructor Summary
Constructors Constructor Description GeoArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeoArgs
asc()
Sort results ascending.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.GeoArgs
desc()
Sort results descending.boolean
isWithCoordinates()
boolean
isWithDistance()
boolean
isWithHash()
GeoArgs
sort(GeoArgs.Sort sort)
Sort results.GeoArgs
withCoordinates()
Request coordinates for results.GeoArgs
withCount(long count)
Limit results tocount
entries.GeoArgs
withCount(long count, boolean any)
Limit results tocount
entries.GeoArgs
withDistance()
Request distance for results.GeoArgs
withHash()
Request geohash for results.
-
-
-
Method Detail
-
withCoordinates
public GeoArgs withCoordinates()
Request coordinates for results.- Returns:
this
GeoArgs
.
-
withCount
public GeoArgs withCount(long count)
Limit results tocount
entries.- Parameters:
count
- number greater 0.- Returns:
this
GeoArgs
.
-
withCount
public GeoArgs withCount(long count, boolean any)
Limit results tocount
entries.- Parameters:
count
- number greater 0.any
- whether to complete the command as soon as enough matches are found, so the results may not be the ones closest to the specified point.- Returns:
this
GeoArgs
.- Since:
- 6.1
-
isWithDistance
public boolean isWithDistance()
- Returns:
true
if distance is requested.
-
isWithCoordinates
public boolean isWithCoordinates()
- Returns:
true
if coordinates are requested.
-
isWithHash
public boolean isWithHash()
- Returns:
true
if geohash is requested.
-
asc
public GeoArgs asc()
Sort results ascending.- Returns:
this
-
desc
public GeoArgs desc()
Sort results descending.- Returns:
this
-
sort
public GeoArgs sort(GeoArgs.Sort sort)
Sort results.- Parameters:
sort
- sort order, must not benull
- Returns:
this
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build command arguments and contribute arguments toCommandArgs
.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-