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.Boundaryto its binary representation suitable for ZRANGEBY* commands, despite ZRANGEBYLEX.static byte[]boundaryToBytesForZRangeByLex(RedisZSetCommands.Range.Boundary boundary, byte[] defaultValue) Converts a givenRedisZSetCommands.Range.Boundaryto 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 givenBitFieldSubCommandsinto argument array.static redis.clients.jedis.BitOPstatic byte[][]toByteArrays(Map<byte[], byte[]> source) static byte[]static byte[]static byte[]static byte[]static ValueEncodingtoEncoding(byte[] source) Convert the givensourcevalue to the correspondingValueEncoding.static redis.clients.jedis.GeoCoordinatetoGeoCoordinate(Point source) ConvertPointintoGeoCoordinate.static redis.clients.jedis.params.GeoRadiusParamConvertRedisGeoCommands.GeoRadiusCommandArgsintoGeoRadiusParam.static redis.clients.jedis.GeoUnitConvertMetricintoGeoUnit.static List<RedisClientInfo>toListOfRedisClientInformation(String source) static List<RedisServer>toListOfRedisServer(List<Map<String, String>> source) static redis.clients.jedis.ListPositionstatic LongtoLong(byte[] source) static RedisClusterNodestatic redis.clients.jedis.ScanParamstoScanParams(ScanOptions options) ConvertScanOptionsto JedisScanParams.static redis.clients.jedis.params.SetParamstoSetCommandExPxArgument(Expiration expiration) Converts a givenExpirationto the accordingSETcommand argument.static redis.clients.jedis.params.SetParamstoSetCommandExPxArgument(Expiration expiration, redis.clients.jedis.params.SetParams params) Converts a givenExpirationto the accordingSETcommand argument.static redis.clients.jedis.params.SetParamsConverts a givenRedisStringCommands.SetOptionto the accordingSETcommand argument.
RedisStringCommands.SetOption.SET_IF_PRESENTXXRedisStringCommands.SetOption.SET_IF_ABSENTNXRedisStringCommands.SetOption.UPSERTbyte[0]static redis.clients.jedis.params.SetParamstoSetCommandNxXxArgument(RedisStringCommands.SetOption option, redis.clients.jedis.params.SetParams params) Converts a givenRedisStringCommands.SetOptionto the accordingSETcommand argument.
RedisStringCommands.SetOption.SET_IF_PRESENTXXRedisStringCommands.SetOption.SET_IF_ABSENTNXRedisStringCommands.SetOption.UPSERTbyte[0]static redis.clients.jedis.SortingParamstoSortingParams(SortParameters params) static StringtoString(byte[] source) static TupletoTuple(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 givensourcevalue to the correspondingValueEncoding.- Parameters:
source- can be null.- Returns:
- the
ValueEncodingfor 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.Boundaryto 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.Boundaryto its binary representation suitable for ZRANGEBYLEX command.- Parameters:
boundary-- Returns:
- Since:
- 1.6
-
toSetCommandExPxArgument
Converts a givenExpirationto the accordingSETcommand 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 givenExpirationto the accordingSETcommand 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
ConvertScanOptionsto 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
ConvertPointintoGeoCoordinate.- 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
ConvertMetricintoGeoUnit.- Parameters:
metric-- Returns:
- Since:
- 1.8
-
toGeoRadiusParam
public static redis.clients.jedis.params.GeoRadiusParam toGeoRadiusParam(RedisGeoCommands.GeoRadiusCommandArgs source) ConvertRedisGeoCommands.GeoRadiusCommandArgsintoGeoRadiusParam.- Parameters:
source-- Returns:
- Since:
- 1.8
-
toBitfieldCommandArguments
Convert givenBitFieldSubCommandsinto argument array.- Parameters:
source-- Returns:
- never null.
- Since:
- 1.8
-