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 classGeoArgs.BuilderBuilder entry points forGeoArgs.static classGeoArgs.SortSort order.static classGeoArgs.UnitSupported geo unit. -
Constructor Summary
Constructors Constructor Description GeoArgs() -
Method Summary
Modifier and Type Method Description GeoArgsasc()Sort results ascending.<K, V> voidbuild(CommandArgs<K,V> args)Build command arguments and contribute arguments toCommandArgs.GeoArgsdesc()Sort results descending.booleanisWithCoordinates()booleanisWithDistance()booleanisWithHash()GeoArgssort(GeoArgs.Sort sort)Sort results.GeoArgswithCoordinates()Request coordinates for results.GeoArgswithCount(long count)Limit results tocountentries.GeoArgswithCount(long count, boolean any)Limit results tocountentries.GeoArgswithDistance()Request distance for results.GeoArgswithHash()Request geohash for results.
-
Constructor Details
-
GeoArgs
public GeoArgs()
-
-
Method Details
-
withDistance
Request distance for results.- Returns:
thisGeoArgs.
-
withCoordinates
Request coordinates for results.- Returns:
thisGeoArgs.
-
withHash
Request geohash for results.- Returns:
thisGeoArgs.
-
withCount
Limit results tocountentries.- Parameters:
count- number greater 0.- Returns:
thisGeoArgs.
-
withCount
Limit results tocountentries.- 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:
thisGeoArgs.- Since:
- 6.1
-
isWithDistance
public boolean isWithDistance()- Returns:
trueif distance is requested.
-
isWithCoordinates
public boolean isWithCoordinates()- Returns:
trueif coordinates are requested.
-
isWithHash
public boolean isWithHash()- Returns:
trueif geohash is requested.
-
asc
Sort results ascending.- Returns:
this
-
desc
Sort results descending.- Returns:
this
-
sort
Sort results.- Parameters:
sort- sort order, must not benull- Returns:
this
-
build
Description copied from interface:CompositeArgumentBuild 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:
buildin interfaceCompositeArgument- Type Parameters:
K- Key type.V- Value type.- Parameters:
args- the command arguments, must not benull.
-