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, John Blum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte[]
static final byte[]
static final byte[]
static final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.core.convert.converter.Converter<Set<byte[]>,
org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> static org.springframework.data.geo.Point
geoCoordinatesToPoint
(io.lettuce.core.GeoCoordinates geoCoordinate) static org.springframework.core.convert.converter.Converter<List<io.lettuce.core.GeoWithin<byte[]>>,
org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter
(org.springframework.data.geo.Metric metric) GetConverter
capable of converingGeoWithin
intoGeoResults
.static List<RedisClusterNode>
partitionsToClusterNodes
(io.lettuce.core.cluster.models.partitions.Partitions source) static org.springframework.core.convert.converter.Converter<List<io.lettuce.core.ScoredValue<byte[]>>,
List<Tuple>> static io.lettuce.core.RedisURI
sentinelConfigurationToRedisURI
(RedisSentinelConfiguration sentinelConfiguration) static org.springframework.core.convert.converter.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
(org.springframework.data.geo.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>
toRange
(org.springframework.data.domain.Range<T> range) Convert aRedisZSetCommands.Range
to a lettuceRange
.static <T> io.lettuce.core.Range<T>
toRange
(org.springframework.data.domain.Range<T> range, boolean convertNumberToBytes) Convert aRange
to a lettuceRange
.static RedisClusterNode
toRedisClusterNode
(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) static <T> io.lettuce.core.Range<T>
toRevRange
(org.springframework.data.domain.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) static org.springframework.core.convert.converter.Converter<io.lettuce.core.TransactionResult,
List<Object>> 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
public static org.springframework.data.geo.Point geoCoordinatesToPoint(@Nullable io.lettuce.core.GeoCoordinates geoCoordinate) -
stringToRedisClientListConverter
public static org.springframework.core.convert.converter.Converter<String,List<RedisClientInfo>> stringToRedisClientListConverter() -
scoredValuesToTupleList
-
toBoolean
public static boolean toBoolean(long value) -
longToBooleanConverter
public static org.springframework.core.convert.converter.Converter<Long,Boolean> longToBooleanConverter()- Since:
- 1.3
-
toLong
-
toBytesSet
-
toBytesList
-
toBytesList
-
toTuple
-
toString
-
toScriptOutputType
-
toBoolean
-
toInt
public static int toInt(boolean value) -
toMap
-
toSortArgs
-
toListOfRedisClientInformation
-
toLimit
Convert aLimit
to a LettuceLimit
.- Returns:
- a lettuce
Limit
. - Since:
- 2.0
-
toRange
public static <T> io.lettuce.core.Range<T> toRange(org.springframework.data.domain.Range<T> range) Convert aRedisZSetCommands.Range
to a lettuceRange
.- Since:
- 2.0
-
toRange
public static <T> io.lettuce.core.Range<T> toRange(org.springframework.data.domain.Range<T> range, boolean convertNumberToBytes) Convert aRange
to a lettuceRange
.- Since:
- 2.2
-
toRevRange
public static <T> io.lettuce.core.Range<T> toRevRange(org.springframework.data.domain.Range<T> range) Convert aRange
to a lettuceRange
and reverse boundaries.- 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
- 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) - 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
public static io.lettuce.core.GeoArgs.Unit toGeoArgsUnit(org.springframework.data.geo.Metric metric) ConvertMetric
intoGeoArgs.Unit
.- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoRadiusCommandArgs
intoGeoArgs
.- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoCommandArgs
intoGeoArgs
.- Since:
- 2.6
-
toBitFieldArgs
ConvertBitFieldSubCommands
intoBitFieldArgs
.- Since:
- 2.1
-
bytesSetToGeoResultsConverter
public static org.springframework.core.convert.converter.Converter<Set<byte[]>,org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> bytesSetToGeoResultsConverter()- Since:
- 1.8
-
geoRadiusResponseToGeoResultsConverter
public static org.springframework.core.convert.converter.Converter<List<io.lettuce.core.GeoWithin<byte[]>>,org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(org.springframework.data.geo.Metric metric) GetConverter
capable of converingGeoWithin
intoGeoResults
.- Since:
- 1.8
-
transactionResultUnwrapper
-