DATAREDIS-1030 - Polishing.

Update Javadoc and remove superfluous afterPropertiesSet call.

Original Pull Request: #473
This commit is contained in:
Christoph Strobl
2019-09-03 14:11:24 +02:00
parent 85669e6e69
commit 1c48021cea
2 changed files with 6 additions and 7 deletions

View File

@@ -46,8 +46,7 @@ public class DefaultRedisScript<T> implements RedisScript<T>, InitializingBean {
/**
* Creates a new {@link DefaultRedisScript}
*/
public DefaultRedisScript() {
}
public DefaultRedisScript() {}
/**
* Creates a new {@link DefaultRedisScript}
@@ -117,9 +116,9 @@ public class DefaultRedisScript<T> implements RedisScript<T>, InitializingBean {
/**
* @param resultType The script result type. Should be one of Long, Boolean, List, or deserialized value type. Can be
* null if the script returns a throw-away status (i.e "OK")
* {@literal null} if the script returns a throw-away status (i.e "OK")
*/
public void setResultType(Class<T> resultType) {
public void setResultType(@Nullable Class<T> resultType) {
this.resultType = resultType;
}

View File

@@ -84,10 +84,11 @@ public interface RedisScript<T> {
}
/**
* Creates new {@link RedisScript} from {@link Resource}.
* Creates new {@link RedisScript} (with throw away result) from the given {@link Resource}.
*
* @param resource must not be {@literal null}.
* @return new instance of {@link RedisScript}.
* @throws IllegalArgumentException if the required argument is {@literal null}.
* @since 2.2
*/
static <T> RedisScript<T> of(Resource resource) {
@@ -96,7 +97,6 @@ public interface RedisScript<T> {
DefaultRedisScript<T> script = new DefaultRedisScript<>();
script.setLocation(resource);
script.afterPropertiesSet();
return script;
}
@@ -107,6 +107,7 @@ public interface RedisScript<T> {
* @param resource must not be {@literal null}.
* @param resultType must not be {@literal null}.
* @return new instance of {@link RedisScript}.
* @throws IllegalArgumentException if any required argument is {@literal null}.
* @since 2.2
*/
static <T> RedisScript<T> of(Resource resource, Class<T> resultType) {
@@ -117,7 +118,6 @@ public interface RedisScript<T> {
DefaultRedisScript<T> script = new DefaultRedisScript<>();
script.setResultType(resultType);
script.setLocation(resource);
script.afterPropertiesSet();
return script;
}