Class LettuceConverters
java.lang.Object
org.springframework.data.redis.connection.convert.Converters
org.springframework.data.redis.connection.lettuce.LettuceConverters
Lettuce type converters
- Author:
- Jennifer Hickey, Christoph Strobl, Thomas Darimont, Mark Paluch, Ninad Divadkar, dengliming, Chris Bono, Vikas Garg
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte[]
static final byte[]
static final byte[]
static final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Converter<Set<byte[]>,
GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> static Point
geoCoordinatesToPoint
(io.lettuce.core.GeoCoordinates geoCoordinate) static Converter<List<io.lettuce.core.GeoWithin<byte[]>>,
GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> static List<RedisClusterNode>
partitionsToClusterNodes
(io.lettuce.core.cluster.models.partitions.Partitions source) static io.lettuce.core.RedisURI
sentinelConfigurationToRedisURI
(RedisSentinelConfiguration sentinelConfiguration) static Converter<String,
List<RedisClientInfo>> static io.lettuce.core.BitFieldArgs
toBitFieldArgs
(BitFieldSubCommands subCommands) ConvertBitFieldSubCommands
intoBitFieldArgs
.static boolean
toBoolean
(long value) static boolean
static byte[]
static byte[]
static byte[]
static byte[]
static List<byte[]>
toBytesList
(io.lettuce.core.KeyValue<byte[], byte[]> source) static List<byte[]>
toBytesList
(Collection<byte[]> source) static Set<byte[]>
toBytesSet
(List<byte[]> source) static io.lettuce.core.GeoArgs
ConvertRedisGeoCommands.GeoCommandArgs
intoGeoArgs
.static io.lettuce.core.GeoArgs
ConvertRedisGeoCommands.GeoRadiusCommandArgs
intoGeoArgs
.static io.lettuce.core.GeoArgs.Unit
toGeoArgsUnit
(Metric metric) ConvertMetric
intoGeoArgs.Unit
.static int
toInt
(boolean value) static io.lettuce.core.Limit
Convert aLimit
to a LettuceLimit
.static List<RedisClientInfo>
toListOfRedisClientInformation
(String clientList) static List<RedisServer>
toListOfRedisServer
(List<Map<String, String>> source) static Long
static Map<byte[],
byte[]> static <T> io.lettuce.core.Range<T>
Convert aRedisZSetCommands.Range
to a lettuceRange
.static <T> io.lettuce.core.Range<T>
Convert aRange
to a lettuceRange
.static RedisClusterNode
toRedisClusterNode
(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) static <T> io.lettuce.core.Range<T>
toRevRange
(Range<T> range) Convert aRange
to a lettuceRange
and reverse boundaries.static io.lettuce.core.ScriptOutputType
toScriptOutputType
(ReturnType returnType) static io.lettuce.core.SetArgs
toSetArgs
(Expiration expiration, RedisStringCommands.SetOption option) static io.lettuce.core.SortArgs
toSortArgs
(SortParameters params) static String
toString
(byte[] source) static Tuple
toTuple
(io.lettuce.core.ScoredValue<byte[]> source) Methods inherited from class org.springframework.data.redis.connection.convert.Converters
deserializingGeoResultsConverter, distanceConverterForMetric, entryOf, identityConverter, listToPropertiesConverter, longToBoolean, mapToPropertiesConverter, millisecondsToTimeUnit, millisecondsToTimeUnit, parse, parse, secondsToDuration, secondsToTimeUnit, secondsToTimeUnit, stringToBoolean, stringToBooleanConverter, stringToDataType, stringToProps, toBit, toBoolean, toClusterNode, toDataType, toObjects, toProperties, toProperties, toProperties, toSetOfRedisClusterNodes, toSetOfRedisClusterNodes, toTimeMillis, toTimeMillis
-
Field Details
-
PLUS_BYTES
public static final byte[] PLUS_BYTES -
MINUS_BYTES
public static final byte[] MINUS_BYTES -
POSITIVE_INFINITY_BYTES
public static final byte[] POSITIVE_INFINITY_BYTES -
NEGATIVE_INFINITY_BYTES
public static final byte[] NEGATIVE_INFINITY_BYTES
-
-
Constructor Details
-
LettuceConverters
public LettuceConverters()
-
-
Method Details
-
geoCoordinatesToPoint
-
stringToRedisClientListConverter
-
scoredValuesToTupleList
-
toBoolean
public static boolean toBoolean(long value) -
longToBooleanConverter
- Returns:
-
toLong
-
toBytesSet
-
toBytesList
-
toBytesList
-
toTuple
-
toString
-
toScriptOutputType
-
toBoolean
-
toInt
public static int toInt(boolean value) -
toMap
-
toSortArgs
-
toListOfRedisClientInformation
-
toLimit
Convert aLimit
to a LettuceLimit
.- Parameters:
limit
-- Returns:
- a lettuce
Limit
. - Since:
- 2.0
-
toRange
Convert aRedisZSetCommands.Range
to a lettuceRange
.- Parameters:
range
-- Returns:
- Since:
- 2.0
-
toRange
Convert aRange
to a lettuceRange
.- Parameters:
range
-convertNumberToBytes
-- Returns:
- Since:
- 2.2
-
toRevRange
Convert aRange
to a lettuceRange
and reverse boundaries.- Parameters:
range
-- Returns:
- Since:
- 2.0
-
toListOfRedisServer
- Parameters:
source
- List of Maps containing node details from SENTINEL REPLICAS or SENTINEL MASTERS. May be empty or null.- Returns:
- List of
RedisServer
's. List is empty if List of Maps is empty. - Since:
- 1.5
-
sentinelConfigurationToRedisURI
public static io.lettuce.core.RedisURI sentinelConfigurationToRedisURI(RedisSentinelConfiguration sentinelConfiguration) - Parameters:
sentinelConfiguration
- the sentinel configuration containing one or more sentinels and a master name. Must not be null- Returns:
- A
RedisURI
containing Redis Sentinel addresses ofRedisSentinelConfiguration
- Since:
- 1.5
-
toBytes
-
toBytes
-
toBytes
-
toBytes
- Parameters:
source
-- Returns:
- Since:
- 1.6
-
partitionsToClusterNodes
public static List<RedisClusterNode> partitionsToClusterNodes(@Nullable io.lettuce.core.cluster.models.partitions.Partitions source) -
toRedisClusterNode
public static RedisClusterNode toRedisClusterNode(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) - Parameters:
source
-- Returns:
- Since:
- 1.7
-
toSetArgs
public static io.lettuce.core.SetArgs toSetArgs(@Nullable Expiration expiration, @Nullable RedisStringCommands.SetOption option) - Parameters:
expiration
- can be null.option
- can be null.- Since:
- 1.7
-
toGeoArgsUnit
ConvertMetric
intoGeoArgs.Unit
.- Parameters:
metric
-- Returns:
- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoRadiusCommandArgs
intoGeoArgs
.- Parameters:
args
-- Returns:
- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoCommandArgs
intoGeoArgs
.- Parameters:
args
-- Returns:
- Since:
- 2.6
-
toBitFieldArgs
ConvertBitFieldSubCommands
intoBitFieldArgs
.- Parameters:
subCommands
-- Returns:
- Since:
- 2.1
-
bytesSetToGeoResultsConverter
public static Converter<Set<byte[]>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> bytesSetToGeoResultsConverter()- Returns:
- Since:
- 1.8
-
geoRadiusResponseToGeoResultsConverter
public static Converter<List<io.lettuce.core.GeoWithin<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(Metric metric) - Parameters:
metric
-- Returns:
- Since:
- 1.8
-
transactionResultUnwrapper
-