public abstract class Converters extends Object
Constructor and Description |
---|
Converters() |
Modifier and Type | Method and Description |
---|---|
static <V> org.springframework.core.convert.converter.Converter<org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>,org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<V>>> |
deserializingGeoResultsConverter(RedisSerializer<V> serializer)
Converter capable of deserializing GeoResults . |
static org.springframework.core.convert.converter.Converter<Double,org.springframework.data.geo.Distance> |
distanceConverterForMetric(org.springframework.data.geo.Metric metric)
Converter capable of converting Double into Distance using given Metric . |
static org.springframework.core.convert.converter.Converter<Long,Boolean> |
longToBoolean() |
static long |
millisecondsToTimeUnit(long milliseconds,
TimeUnit targetUnit)
Converts
milliseconds to the given TimeUnit . |
static org.springframework.core.convert.converter.Converter<Long,Long> |
millisecondsToTimeUnit(TimeUnit timeUnit)
Creates a new
Converter to convert from milliseconds to the given TimeUnit . |
static long |
secondsToTimeUnit(long seconds,
TimeUnit targetUnit)
Converts
seconds to the given TimeUnit . |
static org.springframework.core.convert.converter.Converter<Long,Long> |
secondsToTimeUnit(TimeUnit timeUnit)
Creates a new
Converter to convert from seconds to the given TimeUnit . |
static org.springframework.core.convert.converter.Converter<String,DataType> |
stringToDataType() |
static org.springframework.core.convert.converter.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(Map<?,?> source) |
static Properties |
toProperties(String source) |
static Set<RedisClusterNode> |
toSetOfRedisClusterNodes(Collection<String> lines)
Converts lines from the result of
CLUSTER NODES into RedisClusterNode s. |
static Set<RedisClusterNode> |
toSetOfRedisClusterNodes(String clusterNodes)
Converts the result of
CLUSTER NODES into RedisClusterNode s. |
static Long |
toTimeMillis(String seconds,
String microseconds)
Returns the timestamp constructed from the given
seconds and microseconds . |
public static org.springframework.core.convert.converter.Converter<String,Properties> stringToProps()
public static org.springframework.core.convert.converter.Converter<Long,Boolean> longToBoolean()
public static org.springframework.core.convert.converter.Converter<String,DataType> stringToDataType()
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 RedisClusterNode
s.clusterNodes
- public static Set<RedisClusterNode> toSetOfRedisClusterNodes(String clusterNodes)
CLUSTER NODES
into RedisClusterNode
s.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 org.springframework.core.convert.converter.Converter<Long,Long> secondsToTimeUnit(TimeUnit timeUnit)
Converter
to convert from seconds to the given 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 org.springframework.core.convert.converter.Converter<Long,Long> millisecondsToTimeUnit(TimeUnit timeUnit)
Converter
to convert from milliseconds to the given TimeUnit
.timeUnit
- muist not be null.public static <V> org.springframework.core.convert.converter.Converter<org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>,org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<V>>> deserializingGeoResultsConverter(RedisSerializer<V> serializer)
Converter
capable of deserializing GeoResults
.serializer
- public static org.springframework.core.convert.converter.Converter<Double,org.springframework.data.geo.Distance> distanceConverterForMetric(org.springframework.data.geo.Metric metric)
Converter
capable of converting Double into Distance
using given Metric
.metric
- Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.