Class LettuceConverters
java.lang.Object
io.valkey.springframework.data.valkey.connection.convert.Converters
io.valkey.springframework.data.valkey.connection.lettuce.LettuceConverters
Lettuce type converters. This is an internal class not intended to by used outside of the framework.
- Author:
- Jennifer Hickey, Christoph Strobl, Thomas Darimont, Mark Paluch, Ninad Divadkar, dengliming, Chris Bono, Vikas Garg, John Blum, Roman Osadchuk, Yordan Tsintsov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]static final byte[]static final byte[]static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.core.convert.converter.Converter<Set<byte[]>,org.springframework.data.geo.GeoResults<ValkeyGeoCommands.GeoLocation<byte[]>>> static @Nullable org.springframework.data.geo.PointgeoCoordinatesToPoint(@Nullable io.lettuce.core.GeoCoordinates geoCoordinate) static org.springframework.core.convert.converter.Converter<List<io.lettuce.core.GeoWithin<byte[]>>,org.springframework.data.geo.GeoResults<ValkeyGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(org.springframework.data.geo.Metric metric) GetConvertercapable of converingGeoWithinintoGeoResults.static List<ValkeyClusterNode>partitionsToClusterNodes(@Nullable io.lettuce.core.cluster.models.partitions.Partitions source) static org.springframework.core.convert.converter.Converter<List<io.lettuce.core.ScoredValue<byte[]>>,@Nullable List<Tuple>> static io.lettuce.core.RedisURIsentinelConfigurationToRedisURI(ValkeySentinelConfiguration sentinelConfiguration) static org.springframework.core.convert.converter.Converter<String,List<ValkeyClientInfo>> static io.lettuce.core.BitFieldArgstoBitFieldArgs(@Nullable BitFieldSubCommands subCommands) ConvertBitFieldSubCommandsintoBitFieldArgs.static booleantoBoolean(long value) static booleanstatic byte @Nullable []static byte[]static byte[]static byte[]static @Nullable List<byte[]>toBytesList(@Nullable io.lettuce.core.KeyValue<byte[], byte[]> source) static @Nullable Set<byte[]>toBytesSet(@Nullable List<byte[]> source) static io.lettuce.core.GeoArgsConvertValkeyGeoCommands.GeoCommandArgsintoGeoArgs.static io.lettuce.core.GeoArgsConvertValkeyGeoCommands.GeoRadiusCommandArgsintoGeoArgs.static io.lettuce.core.GeoArgs.UnittoGeoArgsUnit(org.springframework.data.geo.Metric metric) ConvertMetricintoGeoArgs.Unit.static inttoInt(boolean value) static io.lettuce.core.LimitConvert aLimitto a LettuceLimit.static List<ValkeyClientInfo>toListOfValkeyClientInformation(String clientList) static List<ValkeyServer>toListOfValkeyServer(List<Map<String, String>> source) static @Nullable Longstatic Map<byte[],byte[]> static <T> io.lettuce.core.Range<T>toRange(org.springframework.data.domain.Range<T> range) Convert aValkeyZSetCommands.Rangeto a lettuceRange.static <T> io.lettuce.core.Range<T>toRange(org.springframework.data.domain.Range<T> range, boolean convertNumberToBytes) Convert aRangeto a lettuceRange.static ValkeyClusterNodetoRedisClusterNode(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) static <T> io.lettuce.core.Range<T>toRevRange(org.springframework.data.domain.Range<T> range) Convert aRangeto a lettuceRangeand reverse boundaries.static io.lettuce.core.ScriptOutputTypetoScriptOutputType(ReturnType returnType) static io.lettuce.core.SetArgstoSetArgs(@Nullable Expiration expiration, @Nullable ValkeyStringCommands.SetOption option) Deprecated, for removal: This API element is subject to removal in a future version.since 4.1.static io.lettuce.core.SortArgstoSortArgs(SortParameters params) static @Nullable StringtoString(byte @Nullable [] source) static TupletoTuple(@Nullable io.lettuce.core.ScoredValue<byte[]> source) static org.springframework.core.convert.converter.Converter<io.lettuce.core.TransactionResult,List<Object>> Methods inherited from class io.valkey.springframework.data.valkey.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, toSetOfValkeyClusterNodes, toSetOfValkeyClusterNodes, 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 @Nullable org.springframework.data.geo.Point geoCoordinatesToPoint(@Nullable io.lettuce.core.GeoCoordinates geoCoordinate) -
stringToValkeyClientListConverter
public static org.springframework.core.convert.converter.Converter<String,List<ValkeyClientInfo>> stringToValkeyClientListConverter() -
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
@Contract("null -> null;!null -> !null") public static @Nullable List<byte[]> toBytesList(@Nullable io.lettuce.core.KeyValue<byte[], byte[]> source) -
toTuple
@Contract("null -> null;!null -> !null") public static Tuple toTuple(@Nullable io.lettuce.core.ScoredValue<byte[]> source) -
toString
-
toScriptOutputType
-
toBoolean
-
toInt
public static int toInt(boolean value) -
toMap
-
toSortArgs
-
toListOfValkeyClientInformation
-
toLimit
Convert aLimitto 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 aValkeyZSetCommands.Rangeto 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 aRangeto a lettuceRange.- Since:
- 2.2
-
toRevRange
public static <T> io.lettuce.core.Range<T> toRevRange(org.springframework.data.domain.Range<T> range) Convert aRangeto a lettuceRangeand reverse boundaries.- Since:
- 2.0
-
toListOfValkeyServer
- Parameters:
source- List of Maps containing node details from SENTINEL REPLICAS or SENTINEL MASTERS. May be empty or null.- Returns:
- List of
ValkeyServer's. List is empty if List of Maps is empty. - Since:
- 1.5
-
sentinelConfigurationToRedisURI
public static io.lettuce.core.RedisURI sentinelConfigurationToRedisURI(ValkeySentinelConfiguration sentinelConfiguration) - Parameters:
sentinelConfiguration- the sentinel configuration containing one or more sentinels and a master name. Must not be null- Returns:
- A
RedisURIcontaining Valkey Sentinel addresses ofValkeySentinelConfiguration - Since:
- 1.5
-
toBytes
@Contract("null -> null;!null -> !null") public static byte @Nullable [] toBytes(@Nullable String source) -
toBytes
-
toBytes
-
toBytes
- Since:
- 1.6
-
partitionsToClusterNodes
public static List<ValkeyClusterNode> partitionsToClusterNodes(@Nullable io.lettuce.core.cluster.models.partitions.Partitions source) -
toRedisClusterNode
public static ValkeyClusterNode toRedisClusterNode(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) - Since:
- 1.7
-
toSetArgs
@Deprecated(since="4.1", forRemoval=true) public static io.lettuce.core.SetArgs toSetArgs(@Nullable Expiration expiration, @Nullable ValkeyStringCommands.SetOption option) Deprecated, for removal: This API element is subject to removal in a future version.since 4.1.- 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) ConvertMetricintoGeoArgs.Unit.- Since:
- 1.8
-
toGeoArgs
ConvertValkeyGeoCommands.GeoRadiusCommandArgsintoGeoArgs.- Since:
- 1.8
-
toGeoArgs
ConvertValkeyGeoCommands.GeoCommandArgsintoGeoArgs.- Since:
- 2.6
-
toBitFieldArgs
public static io.lettuce.core.BitFieldArgs toBitFieldArgs(@Nullable BitFieldSubCommands subCommands) ConvertBitFieldSubCommandsintoBitFieldArgs.- Since:
- 2.1
-
bytesSetToGeoResultsConverter
public static org.springframework.core.convert.converter.Converter<Set<byte[]>,org.springframework.data.geo.GeoResults<ValkeyGeoCommands.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<ValkeyGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(org.springframework.data.geo.Metric metric) GetConvertercapable of converingGeoWithinintoGeoResults.- Since:
- 1.8
-
transactionResultUnwrapper
-