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
FieldsModifier and TypeFieldDescriptionstatic final byte[]static final byte[]static final byte[]static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringboundaryToBytesForZRange(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Deprecated.static StringboundaryToBytesForZRangeByLex(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Deprecated.static StringboundaryToStringForZRange(RedisZSetCommands.Range.Boundary boundary, String defaultValue) Deprecated.static Converter<Collection<byte[]>,List<byte[]>> Deprecated.Deprecated.Deprecated.static Converter<List<byte[]>,List<RedisZSetCommands.Tuple>> Deprecated.static Converter<Collection<byte[]>,List<byte[]>> Deprecated.static Converter<Set<byte[]>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> Deprecated.Deprecated.static Converter<Exception,DataAccessException> Deprecated.static PointgeoCoordinatesToPoint(io.lettuce.core.GeoCoordinates geoCoordinate) static ListConverter<io.lettuce.core.GeoCoordinates,Point> Deprecated.static Converter<List<io.lettuce.core.GeoWithin<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> static <K,V> ListConverter<io.lettuce.core.KeyValue<K, V>, V> Deprecated.Deprecated.static List<RedisClusterNode>partitionsToClusterNodes(io.lettuce.core.cluster.models.partitions.Partitions source) static Converter<List<io.lettuce.core.ScoredValue<byte[]>>,List<RedisZSetCommands.Tuple>> static Converter<List<io.lettuce.core.ScoredValue<byte[]>>,Set<RedisZSetCommands.Tuple>> Deprecated.static Converter<io.lettuce.core.ScoredValue<byte[]>,RedisZSetCommands.Tuple> Deprecated.static io.lettuce.core.RedisURIsentinelConfigurationToRedisURI(RedisSentinelConfiguration sentinelConfiguration) static Converter<String,List<RedisClientInfo>> static byte[][]subarray(byte[][] input, int index) Deprecated.static io.lettuce.core.BitFieldArgstoBitFieldArgs(BitFieldSubCommands subCommands) ConvertBitFieldSubCommandsintoBitFieldArgs.static booleanstatic 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.GeoArgsConvertRedisGeoCommands.GeoCommandArgsintoGeoArgs.static io.lettuce.core.GeoArgsConvertRedisGeoCommands.GeoRadiusCommandArgsintoGeoArgs.static io.lettuce.core.GeoArgs.UnittoGeoArgsUnit(Metric metric) ConvertMetricintoGeoArgs.Unit.static inttoInt(boolean value) static io.lettuce.core.LimittoLimit(RedisZSetCommands.Limit limit) Convert aRedisZSetCommands.Limitto a LettuceLimit.static List<RedisClientInfo>toListOfRedisClientInformation(String clientList) static List<RedisServer>toListOfRedisServer(List<Map<String, String>> source) static Longstatic Map<byte[],byte[]> static <T> io.lettuce.core.Range<T>toRange(RedisZSetCommands.Range range) Convert aRedisZSetCommands.Rangeto a lettuceRange.static <T> io.lettuce.core.Range<T>toRange(RedisZSetCommands.Range range, boolean convertNumberToBytes) Convert aRedisZSetCommands.Rangeto a lettuceRange.static RedisClusterNodetoRedisClusterNode(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) static <T> io.lettuce.core.Range<T>Convert aRedisZSetCommands.Rangeto a lettuceRangeand reverse boundaries.static io.lettuce.core.ScriptOutputTypetoScriptOutputType(ReturnType returnType) static io.lettuce.core.SetArgstoSetArgs(Expiration expiration, RedisStringCommands.SetOption option) static io.lettuce.core.SortArgstoSortArgs(SortParameters params) static StringtoString(byte[] source) static RedisZSetCommands.TupletoTuple(io.lettuce.core.ScoredValue<byte[]> source) static List<RedisZSetCommands.Tuple>Deprecated.static Set<RedisZSetCommands.Tuple>toTupleSet(List<io.lettuce.core.ScoredValue<byte[]>> source) Deprecated.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
-
toTuple
Deprecated. -
bytesListToTupleListConverter
@Deprecated public static Converter<List<byte[]>,List<RedisZSetCommands.Tuple>> bytesListToTupleListConverter()Deprecated. -
geoCoordinatesToPoint
-
stringToRedisClientListConverter
-
dateToLong
Deprecated. -
bytesListToBytesSet
Deprecated. -
bytesToString
Deprecated. -
keyValueToBytesList
@Deprecated public static Converter<io.lettuce.core.KeyValue<byte[],byte[]>, keyValueToBytesList()List<byte[]>> Deprecated. -
bytesSetToBytesList
Deprecated. -
bytesCollectionToBytesList
Deprecated. -
scoredValuesToTupleSet
@Deprecated public static Converter<List<io.lettuce.core.ScoredValue<byte[]>>,Set<RedisZSetCommands.Tuple>> scoredValuesToTupleSet()Deprecated. -
scoredValuesToTupleList
public static Converter<List<io.lettuce.core.ScoredValue<byte[]>>,List<RedisZSetCommands.Tuple>> scoredValuesToTupleList() -
scoredValueToTuple
@Deprecated public static Converter<io.lettuce.core.ScoredValue<byte[]>,RedisZSetCommands.Tuple> scoredValueToTuple()Deprecated. -
exceptionConverter
Deprecated. -
longToBooleanConverter
- Returns:
-
toLong
-
toBytesSet
-
toBytesList
-
toBytesList
-
toTupleSet
@Deprecated public static Set<RedisZSetCommands.Tuple> toTupleSet(@Nullable List<io.lettuce.core.ScoredValue<byte[]>> source) Deprecated. -
toTuple
-
toString
-
toScriptOutputType
-
toBoolean
-
toInt
public static int toInt(boolean value) -
toMap
-
bytesListToMapConverter
Deprecated. -
toSortArgs
-
toListOfRedisClientInformation
-
subarray
Deprecated. -
boundaryToStringForZRange
@Deprecated public static String boundaryToStringForZRange(RedisZSetCommands.Range.Boundary boundary, String defaultValue) Deprecated. -
toLimit
Convert aRedisZSetCommands.Limitto a LettuceLimit.- Parameters:
limit-- Returns:
- a lettuce
Limit. - Since:
- 2.0
-
toRange
Convert aRedisZSetCommands.Rangeto a lettuceRange.- Parameters:
range-- Returns:
- Since:
- 2.0
-
toRange
public static <T> io.lettuce.core.Range<T> toRange(RedisZSetCommands.Range range, boolean convertNumberToBytes) Convert aRedisZSetCommands.Rangeto a lettuceRange.- Parameters:
range-convertNumberToBytes-- Returns:
- Since:
- 2.2
-
toRevRange
Convert aRedisZSetCommands.Rangeto a lettuceRangeand reverse boundaries.- Parameters:
range-- Returns:
- Since:
- 2.0
-
toListOfRedisServer
- Parameters:
source- List of Maps containing node details from SENTINEL SLAVES 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
RedisURIcontaining Redis Sentinel addresses ofRedisSentinelConfiguration - Since:
- 1.5
-
toBytes
-
toBytes
-
toBytes
-
toBytes
- Parameters:
source-- Returns:
- Since:
- 1.6
-
boundaryToBytesForZRange
@Deprecated public static String boundaryToBytesForZRange(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Deprecated.Converts a givenRedisZSetCommands.Range.Boundaryto its binary representation suitable for ZRANGEBY* commands, despite ZRANGEBYLEX.- Parameters:
boundary-defaultValue-- Returns:
- Since:
- 1.6
-
boundaryToBytesForZRangeByLex
@Deprecated public static String boundaryToBytesForZRangeByLex(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Deprecated.Converts a givenRedisZSetCommands.Range.Boundaryto its binary representation suitable for ZRANGEBYLEX command.- Parameters:
boundary-- 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
ConvertMetricintoGeoArgs.Unit.- Parameters:
metric-- Returns:
- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoRadiusCommandArgsintoGeoArgs.- Parameters:
args-- Returns:
- Since:
- 1.8
-
toGeoArgs
ConvertRedisGeoCommands.GeoCommandArgsintoGeoArgs.- Parameters:
args-- Returns:
- Since:
- 2.6
-
toBitFieldArgs
ConvertBitFieldSubCommandsintoBitFieldArgs.- 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
-
geoCoordinatesToPointConverter
@Deprecated public static ListConverter<io.lettuce.core.GeoCoordinates,Point> geoCoordinatesToPointConverter()Deprecated.- Returns:
- Since:
- 1.8
-
keyValueListUnwrapper
@Deprecated public static <K,V> ListConverter<io.lettuce.core.KeyValue<K,V>, keyValueListUnwrapper()V> Deprecated.- Returns:
- Since:
- 2.0
-
transactionResultUnwrapper
-