Skip to content

Commit

Permalink
DATAREDIS-1030 - Polishing.
Browse files Browse the repository at this point in the history
Update Javadoc and remove superfluous afterPropertiesSet call.

Original Pull Request: #473
  • Loading branch information
christophstrobl committed Sep 4, 2019
1 parent 85669e6 commit 1c48021
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -117,9 +116,9 @@ public String getScriptAsString() {

/**
* @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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ static <T> RedisScript of(String script, Class<T> resultType) {
}

/**
* 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) {
Expand All @@ -96,7 +97,6 @@ static <T> RedisScript<T> of(Resource resource) {

DefaultRedisScript<T> script = new DefaultRedisScript<>();
script.setLocation(resource);
script.afterPropertiesSet();

return script;
}
Expand All @@ -107,6 +107,7 @@ static <T> RedisScript<T> of(Resource resource) {
* @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) {
Expand All @@ -117,7 +118,6 @@ static <T> RedisScript<T> of(Resource resource, Class<T> resultType) {
DefaultRedisScript<T> script = new DefaultRedisScript<>();
script.setResultType(resultType);
script.setLocation(resource);
script.afterPropertiesSet();

return script;
}
Expand Down

0 comments on commit 1c48021

Please sign in to comment.