Class LettuceConverters

java.lang.Object
org.springframework.data.redis.connection.convert.Converters
org.springframework.data.redis.connection.lettuce.LettuceConverters

public abstract class LettuceConverters extends Converters
Lettuce type converters
Author:
Jennifer Hickey, Christoph Strobl, Thomas Darimont, Mark Paluch, Ninad Divadkar, dengliming, Chris Bono, Vikas Garg
  • 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 Point geoCoordinatesToPoint(@Nullable io.lettuce.core.GeoCoordinates geoCoordinate)
    • stringToRedisClientListConverter

      public static Converter<String,List<RedisClientInfo>> stringToRedisClientListConverter()
    • scoredValuesToTupleList

      public static Converter<List<io.lettuce.core.ScoredValue<byte[]>>,List<Tuple>> scoredValuesToTupleList()
    • toBoolean

      public static boolean toBoolean(long value)
    • longToBooleanConverter

      public static Converter<Long,Boolean> longToBooleanConverter()
      Returns:
    • toLong

      public static Long toLong(@Nullable Date source)
    • toBytesSet

      public static Set<byte[]> toBytesSet(@Nullable List<byte[]> source)
    • toBytesList

      public static List<byte[]> toBytesList(io.lettuce.core.KeyValue<byte[],byte[]> source)
    • toBytesList

      public static List<byte[]> toBytesList(Collection<byte[]> source)
    • toTuple

      public static Tuple toTuple(@Nullable io.lettuce.core.ScoredValue<byte[]> source)
    • toString

      public static String toString(@Nullable byte[] source)
    • toScriptOutputType

      public static io.lettuce.core.ScriptOutputType toScriptOutputType(ReturnType returnType)
    • toBoolean

      public static boolean toBoolean(RedisListCommands.Position where)
    • toInt

      public static int toInt(boolean value)
    • toMap

      public static Map<byte[],byte[]> toMap(List<byte[]> source)
    • toSortArgs

      public static io.lettuce.core.SortArgs toSortArgs(SortParameters params)
    • toListOfRedisClientInformation

      public static List<RedisClientInfo> toListOfRedisClientInformation(String clientList)
    • toLimit

      public static io.lettuce.core.Limit toLimit(Limit limit)
      Convert a Limit to a Lettuce Limit.
      Parameters:
      limit -
      Returns:
      a lettuce Limit.
      Since:
      2.0
    • toRange

      public static <T> io.lettuce.core.Range<T> toRange(Range<T> range)
      Convert a RedisZSetCommands.Range to a lettuce Range.
      Parameters:
      range -
      Returns:
      Since:
      2.0
    • toRange

      public static <T> io.lettuce.core.Range<T> toRange(Range<T> range, boolean convertNumberToBytes)
      Convert a Range to a lettuce Range.
      Parameters:
      range -
      convertNumberToBytes -
      Returns:
      Since:
      2.2
    • toRevRange

      public static <T> io.lettuce.core.Range<T> toRevRange(Range<T> range)
      Convert a Range to a lettuce Range and reverse boundaries.
      Parameters:
      range -
      Returns:
      Since:
      2.0
    • toListOfRedisServer

      public static List<RedisServer> toListOfRedisServer(List<Map<String,String>> source)
      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 of RedisSentinelConfiguration
      Since:
      1.5
    • toBytes

      public static byte[] toBytes(@Nullable String source)
    • toBytes

      public static byte[] toBytes(Integer source)
    • toBytes

      public static byte[] toBytes(Long source)
    • toBytes

      public static byte[] toBytes(Double source)
      Parameters:
      source -
      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)
      Converts a given Expiration and RedisStringCommands.SetOption to the according SetArgs.
      Parameters:
      expiration - can be null.
      option - can be null.
      Since:
      1.7
    • toGeoArgsUnit

      public static io.lettuce.core.GeoArgs.Unit toGeoArgsUnit(Metric metric)
      Convert Metric into GeoArgs.Unit.
      Parameters:
      metric -
      Returns:
      Since:
      1.8
    • toGeoArgs

      public static io.lettuce.core.GeoArgs toGeoArgs(RedisGeoCommands.GeoRadiusCommandArgs args)
      Parameters:
      args -
      Returns:
      Since:
      1.8
    • toGeoArgs

      public static io.lettuce.core.GeoArgs toGeoArgs(RedisGeoCommands.GeoCommandArgs args)
      Convert RedisGeoCommands.GeoCommandArgs into GeoArgs.
      Parameters:
      args -
      Returns:
      Since:
      2.6
    • toBitFieldArgs

      public static io.lettuce.core.BitFieldArgs toBitFieldArgs(BitFieldSubCommands subCommands)
      Convert BitFieldSubCommands into BitFieldArgs.
      Parameters:
      subCommands -
      Returns:
      Since:
      2.1
    • bytesSetToGeoResultsConverter

      public static Converter<Set<byte[]>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> bytesSetToGeoResultsConverter()
      Get Converter capable of Set of Byte into GeoResults.
      Returns:
      Since:
      1.8
    • geoRadiusResponseToGeoResultsConverter

      public static Converter<List<io.lettuce.core.GeoWithin<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<byte[]>>> geoRadiusResponseToGeoResultsConverter(Metric metric)
      Get Converter capable of convering GeoWithin into GeoResults.
      Parameters:
      metric -
      Returns:
      Since:
      1.8
    • transactionResultUnwrapper

      public static Converter<io.lettuce.core.TransactionResult,List<Object>> transactionResultUnwrapper()