DATAREDIS-1179 - Polishing.

Reorder methods. Make MappingRedisConverter(RedisMappingContext) public. Tweak docs wording.

Original pull request: #548.
This commit is contained in:
Mark Paluch
2020-07-15 10:41:54 +02:00
parent 3453558d5c
commit 9267f39abb
4 changed files with 35 additions and 31 deletions

View File

@@ -129,8 +129,9 @@ public class MappingRedisConverter implements RedisConverter, InitializingBean {
* Creates new {@link MappingRedisConverter}.
*
* @param context can be {@literal null}.
* @since 2.4
*/
MappingRedisConverter(RedisMappingContext context) {
public MappingRedisConverter(RedisMappingContext context) {
this(context, null, null, null);
}

View File

@@ -80,6 +80,19 @@ public class ObjectHashMapper implements HashMapper<Object, byte[], byte[]> {
this(new RedisCustomConversions());
}
/**
* Creates a new {@link ObjectHashMapper} using the given {@link RedisConverter} for conversion.
*
* @param converter must not be {@literal null}.
* @throws IllegalArgumentException if the given {@literal converter} is {@literal null}.
* @since 2.4
*/
public ObjectHashMapper(RedisConverter converter) {
Assert.notNull(converter, "Converter must not be null!");
this.converter = converter;
}
/**
* Creates new {@link ObjectHashMapper}.
*
@@ -107,19 +120,6 @@ public class ObjectHashMapper implements HashMapper<Object, byte[], byte[]> {
converter = mappingConverter;
}
/**
* Creates a new {@link ObjectHashMapper} using the given {@link RedisConverter} for conversion.
*
* @param converter must not be {@literal null}.
* @throws IllegalArgumentException if the given {@literal converter} is {@literal null}.
* @since 2.4
*/
public ObjectHashMapper(RedisConverter converter) {
Assert.notNull(converter, "Converter must not be null!");
this.converter = converter;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.hash.HashMapper#toHash(java.lang.Object)