Class JedisConverters
java.lang.Object
org.springframework.data.redis.connection.convert.Converters
org.springframework.data.redis.connection.jedis.JedisConverters
Jedis type converters.
- Author:
- Jennifer Hickey, Christoph Strobl, Thomas Darimont, Jungtaek Lim, Mark Paluch, Ninad Divadkar, Guy Korland, dengliming
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]
static final byte[]
static final byte[]
static final byte[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
boundaryToBytesForZRange
(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Converts a givenRedisZSetCommands.Range.Boundary
to its binary representation suitable for ZRANGEBY* commands, despite ZRANGEBYLEX.static byte[]
boundaryToBytesForZRangeByLex
(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Converts a givenRedisZSetCommands.Range.Boundary
to its binary representation suitable for ZRANGEBYLEX command.static ListConverter<redis.clients.jedis.GeoCoordinate,
Point> static Converter<List<redis.clients.jedis.GeoRadiusResponse>,
GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> static byte[][]
Convert givenBitFieldSubCommands
into argument array.static redis.clients.jedis.BitOP
static byte[][]
toByteArrays
(Map<byte[], byte[]> source) static byte[]
static byte[]
static byte[]
static byte[]
static ValueEncoding
toEncoding
(byte[] source) Convert the givensource
value to the correspondingValueEncoding
.static redis.clients.jedis.GeoCoordinate
toGeoCoordinate
(Point source) ConvertPoint
intoGeoCoordinate
.static redis.clients.jedis.params.GeoRadiusParam
ConvertRedisGeoCommands.GeoRadiusCommandArgs
intoGeoRadiusParam
.static redis.clients.jedis.GeoUnit
ConvertMetric
intoGeoUnit
.static List<RedisClientInfo>
toListOfRedisClientInformation
(String source) static List<RedisServer>
toListOfRedisServer
(List<Map<String, String>> source) static redis.clients.jedis.ListPosition
static Long
toLong
(byte[] source) static RedisClusterNode
static redis.clients.jedis.ScanParams
toScanParams
(ScanOptions options) ConvertScanOptions
to JedisScanParams
.static redis.clients.jedis.params.SetParams
toSetCommandExPxArgument
(Expiration expiration) Converts a givenExpiration
to the accordingSET
command argument.static redis.clients.jedis.params.SetParams
toSetCommandExPxArgument
(Expiration expiration, redis.clients.jedis.params.SetParams params) Converts a givenExpiration
to the accordingSET
command argument.static redis.clients.jedis.params.SetParams
Converts a givenRedisStringCommands.SetOption
to the accordingSET
command argument.
RedisStringCommands.SetOption.SET_IF_PRESENT
XX
RedisStringCommands.SetOption.SET_IF_ABSENT
NX
RedisStringCommands.SetOption.UPSERT
byte[0]
static redis.clients.jedis.params.SetParams
toSetCommandNxXxArgument
(RedisStringCommands.SetOption option, redis.clients.jedis.params.SetParams params) Converts a givenRedisStringCommands.SetOption
to the accordingSET
command argument.
RedisStringCommands.SetOption.SET_IF_PRESENT
XX
RedisStringCommands.SetOption.SET_IF_ABSENT
NX
RedisStringCommands.SetOption.UPSERT
byte[0]
static redis.clients.jedis.SortingParams
toSortingParams
(SortParameters params) static String
toString
(byte[] source) static Tuple
toTuple
(redis.clients.jedis.Tuple source) toTupleMap
(Set<Tuple> tuples) 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
-
JedisConverters
public JedisConverters()
-
-
Method Details
-
stringToBytes
-
toTuple
-
toTupleMap
- Parameters:
tuples
- must not be null.- Returns:
- Since:
- 2.0
-
toBytes
-
toBytes
-
toBytes
- Parameters:
source
-- Returns:
- Since:
- 1.6
-
toBytes
-
toString
-
toLong
-
toEncoding
Convert the givensource
value to the correspondingValueEncoding
.- Parameters:
source
- can be null.- Returns:
- the
ValueEncoding
for givensource
. Never null. - Since:
- 2.1
-
toNode
- Parameters:
source
-- Returns:
- Since:
- 1.7
-
toListOfRedisClientInformation
- Parameters:
source
-- Returns:
- Since:
- 1.3
-
toListOfRedisServer
- Parameters:
source
-- Returns:
- Since:
- 1.4
-
toListPosition
-
toByteArrays
-
toSortingParams
@Nullable public static redis.clients.jedis.SortingParams toSortingParams(@Nullable SortParameters params) -
toBitOp
-
boundaryToBytesForZRange
public static byte[] boundaryToBytesForZRange(@Nullable RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Converts a givenRedisZSetCommands.Range.Boundary
to its binary representation suitable for ZRANGEBY* commands, despite ZRANGEBYLEX.- Parameters:
boundary
-defaultValue
-- Returns:
- Since:
- 1.6
-
boundaryToBytesForZRangeByLex
public static byte[] boundaryToBytesForZRangeByLex(@Nullable RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Converts a givenRedisZSetCommands.Range.Boundary
to its binary representation suitable for ZRANGEBYLEX command.- Parameters:
boundary
-- Returns:
- Since:
- 1.6
-
toSetCommandExPxArgument
Converts a givenExpiration
to the accordingSET
command argument.- Parameters:
expiration
- must not be null.- Returns:
- Since:
- 2.2
-
toSetCommandExPxArgument
public static redis.clients.jedis.params.SetParams toSetCommandExPxArgument(Expiration expiration, redis.clients.jedis.params.SetParams params) Converts a givenExpiration
to the accordingSET
command argument.- Parameters:
expiration
- must not be null.params
-- Returns:
- Since:
- 2.2
-
toSetCommandNxXxArgument
public static redis.clients.jedis.params.SetParams toSetCommandNxXxArgument(RedisStringCommands.SetOption option) - Parameters:
option
- must not be null.- Returns:
- Since:
- 2.2
-
toSetCommandNxXxArgument
public static redis.clients.jedis.params.SetParams toSetCommandNxXxArgument(RedisStringCommands.SetOption option, redis.clients.jedis.params.SetParams params) - Parameters:
option
- must not be null.params
-- Returns:
- Since:
- 2.2
-
toScanParams
ConvertScanOptions
to JedisScanParams
.- Parameters:
options
-- Returns:
-
toStrings
- Parameters:
source
-- Returns:
- Since:
- 1.8
-
geoCoordinateToPointConverter
public static ListConverter<redis.clients.jedis.GeoCoordinate,Point> geoCoordinateToPointConverter()- Returns:
- Since:
- 1.8
-
toGeoCoordinate
ConvertPoint
intoGeoCoordinate
.- Parameters:
source
-- Returns:
- Since:
- 1.8
-
geoRadiusResponseToGeoResultsConverter
public static Converter<List<redis.clients.jedis.GeoRadiusResponse>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(Metric metric) - Parameters:
metric
-- Returns:
- Since:
- 1.8
-
toGeoUnit
ConvertMetric
intoGeoUnit
.- Parameters:
metric
-- Returns:
- Since:
- 1.8
-
toGeoRadiusParam
public static redis.clients.jedis.params.GeoRadiusParam toGeoRadiusParam(RedisGeoCommands.GeoRadiusCommandArgs source) ConvertRedisGeoCommands.GeoRadiusCommandArgs
intoGeoRadiusParam
.- Parameters:
source
-- Returns:
- Since:
- 1.8
-
toBitfieldCommandArguments
Convert givenBitFieldSubCommands
into argument array.- Parameters:
source
-- Returns:
- never null.
- Since:
- 1.8
-