public abstract class Converters extends Object
| Constructor and Description |
|---|
Converters() |
| Modifier and Type | Method and Description |
|---|---|
static <V> Converter<GeoResults<RedisGeoCommands.GeoLocation<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<V>>> |
deserializingGeoResultsConverter(RedisSerializer<V> serializer)
Converter capable of deserializing GeoResults. |
static Converter<Double,Distance> |
distanceConverterForMetric(Metric metric)
|
static Converter<List<String>,Properties> |
listToPropertiesConverter()
Returns a converter to convert array outputs with key-value sequences (such as produced by
CONFIG GET) from
a List to Properties. |
static Converter<Long,Boolean> |
longToBoolean() |
static <K,V> Converter<Map<K,V>,Properties> |
mapToPropertiesConverter()
Returns a converter to convert from
Map to Properties. |
static long |
millisecondsToTimeUnit(long milliseconds,
TimeUnit targetUnit)
Converts
milliseconds to the given TimeUnit. |
static Converter<Long,Long> |
millisecondsToTimeUnit(TimeUnit timeUnit)
|
static Duration |
secondsToDuration(Long seconds)
Convert the given nullable seconds to a
Duration or null. |
static long |
secondsToTimeUnit(long seconds,
TimeUnit targetUnit)
Converts
seconds to the given TimeUnit. |
static Converter<Long,Long> |
secondsToTimeUnit(TimeUnit timeUnit)
|
static Boolean |
stringToBoolean(String s) |
static Converter<String,Boolean> |
stringToBooleanConverter() |
static Converter<String,DataType> |
stringToDataType() |
static Converter<String,Properties> |
stringToProps() |
static byte[] |
toBit(Boolean source) |
static Boolean |
toBoolean(Long source) |
protected static RedisClusterNode |
toClusterNode(String clusterNodesLine)
Converts the result of a single line of
CLUSTER NODES into a RedisClusterNode. |
static DataType |
toDataType(String source) |
static List<Object> |
toObjects(Set<RedisZSetCommands.Tuple> tuples) |
static Properties |
toProperties(List<String> input)
Converts array outputs with key-value sequences (such as produced by
CONFIG GET) from a List to
Properties. |
static Properties |
toProperties(Map<?,?> source) |
static Properties |
toProperties(String source) |
static Set<RedisClusterNode> |
toSetOfRedisClusterNodes(Collection<String> lines)
Converts lines from the result of
CLUSTER NODES into RedisClusterNodes. |
static Set<RedisClusterNode> |
toSetOfRedisClusterNodes(String clusterNodes)
Converts the result of
CLUSTER NODES into RedisClusterNodes. |
static Long |
toTimeMillis(String seconds,
String microseconds)
Returns the timestamp constructed from the given
seconds and microseconds. |
public static Converter<String,Properties> stringToProps()
public static Properties toProperties(String source)
public static Properties toProperties(Map<?,?> source)
public static byte[] toBit(Boolean source)
protected static RedisClusterNode toClusterNode(String clusterNodesLine)
CLUSTER NODES into a RedisClusterNode.clusterNodesLine - public static Set<RedisClusterNode> toSetOfRedisClusterNodes(Collection<String> lines)
CLUSTER NODES into RedisClusterNodes.lines - public static Set<RedisClusterNode> toSetOfRedisClusterNodes(String clusterNodes)
CLUSTER NODES into RedisClusterNodes.clusterNodes - public static List<Object> toObjects(Set<RedisZSetCommands.Tuple> tuples)
public static Long toTimeMillis(String seconds, String microseconds)
seconds and microseconds.seconds - server time in secondsmicroseconds - elapsed microseconds in current secondpublic static long secondsToTimeUnit(long seconds,
TimeUnit targetUnit)
seconds to the given TimeUnit.seconds - targetUnit - must not be null.public static Converter<Long,Long> secondsToTimeUnit(TimeUnit timeUnit)
timeUnit - muist not be null.public static long millisecondsToTimeUnit(long milliseconds,
TimeUnit targetUnit)
milliseconds to the given TimeUnit.milliseconds - targetUnit - must not be null.public static Converter<Long,Long> millisecondsToTimeUnit(TimeUnit timeUnit)
timeUnit - muist not be null.public static <V> Converter<GeoResults<RedisGeoCommands.GeoLocation<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<V>>> deserializingGeoResultsConverter(RedisSerializer<V> serializer)
Converter capable of deserializing GeoResults.serializer - public static Converter<Double,Distance> distanceConverterForMetric(Metric metric)
metric - public static Properties toProperties(List<String> input)
CONFIG GET) from a List to
Properties.input - must not be null.public static Converter<List<String>,Properties> listToPropertiesConverter()
CONFIG GET) from
a List to Properties.public static <K,V> Converter<Map<K,V>,Properties> mapToPropertiesConverter()
Map to Properties.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.