diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java index 5d8de9a09..69dd4daaf 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicDouble.java @@ -54,7 +54,8 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO private final RedisOperations generalOps; /** - * Constructs a new {@link RedisAtomicDouble} instance. Uses the value existing in Redis or 0 if none is found. + * Constructs a new {@link RedisAtomicDouble} instance. Uses the value existing in Redis or {@code 0} if none is + * found. * * @param redisCounter Redis key of this counter. * @param factory connection factory. @@ -64,11 +65,11 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO } /** - * Constructs a new {@link RedisAtomicDouble} instance. + * Constructs a new {@link RedisAtomicDouble} instance with a {@code initialValue} that overwrites the existing value. * * @param redisCounter Redis key of this counter. * @param factory connection factory. - * @param initialValue initial value to set if the Redis key is absent. + * @param initialValue initial value to set. */ public RedisAtomicDouble(String redisCounter, RedisConnectionFactory factory, double initialValue) { this(redisCounter, factory, Double.valueOf(initialValue)); @@ -109,10 +110,14 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO } /** - * Constructs a new {@link RedisAtomicDouble} instance. Note: You need to configure the given {@code template} with - * appropriate {@link RedisSerializer} for the key and value. As an alternative one could use the - * {@link #RedisAtomicDouble(String, RedisConnectionFactory, Double)} constructor which uses appropriate default - * serializers. + * Constructs a new {@link RedisAtomicDouble} instance with a {@code initialValue} that overwrites the existing value + * at {@code redisCounter}. + *

+ * Note: You need to configure the given {@code template} with appropriate {@link RedisSerializer} for the key and + * value. + *

+ * As an alternative one could use the {@link #RedisAtomicDouble(String, RedisConnectionFactory, Double)} constructor + * which uses appropriate default serializers. * * @param redisCounter Redis key of this counter. * @param template the template diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java index e1610bd32..fe7cddad1 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java @@ -55,7 +55,8 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey private final RedisOperations generalOps; /** - * Constructs a new {@link RedisAtomicInteger} instance. Uses the value existing in Redis or 0 if none is found. + * Constructs a new {@link RedisAtomicInteger} instance. Uses the value existing in Redis or {@code 0} if none is + * found. * * @param redisCounter Redis key of this counter. * @param factory connection factory. @@ -65,18 +66,20 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey } /** - * Constructs a new {@link RedisAtomicInteger} instance. + * Constructs a new {@link RedisAtomicInteger} instance with a {@code initialValue} that overwrites the existing + * value. * * @param redisCounter Redis key of this counter. * @param factory connection factory. - * @param initialValue initial value to set if the Redis key is absent. + * @param initialValue initial value to set. */ public RedisAtomicInteger(String redisCounter, RedisConnectionFactory factory, int initialValue) { this(redisCounter, factory, Integer.valueOf(initialValue)); } /** - * Constructs a new {@link RedisAtomicInteger} instance. Uses the value existing in Redis or 0 if none is found. + * Constructs a new {@link RedisAtomicInteger} instance. Uses the value existing in Redis or {@code 0} if none is + * found. * * @param redisCounter Redis key of this counter. * @param template the template. @@ -87,10 +90,14 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey } /** - * Constructs a new {@link RedisAtomicInteger} instance. Note: You need to configure the given {@code template} with - * appropriate {@link RedisSerializer} for the key and value. As an alternative one could use the - * {@link #RedisAtomicInteger(String, RedisConnectionFactory, Integer)} constructor which uses appropriate default - * serializers. + * Constructs a new {@link RedisAtomicInteger} instance instance with a {@code initialValue} that overwrites the + * existing value. + *

+ * Note: You need to configure the given {@code template} with appropriate {@link RedisSerializer} for the key and + * value. + *

+ * As an alternative one could use the {@link #RedisAtomicInteger(String, RedisConnectionFactory, Integer)} + * constructor which uses appropriate default serializers. * * @param redisCounter Redis key of this counter. * @param template the template. diff --git a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java index 052d6ede9..ea683e953 100644 --- a/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java @@ -56,7 +56,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe private final RedisOperations generalOps; /** - * Constructs a new {@link RedisAtomicLong} instance. Uses the value existing in Redis or 0 if none is found. + * Constructs a new {@link RedisAtomicLong} instance. Uses the value existing in Redis or {@code 0} if none is found. * * @param redisCounter Redis key of this counter. * @param factory connection factory. @@ -66,11 +66,12 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe } /** - * Constructs a new {@link RedisAtomicLong} instance. + * Constructs a new {@link RedisAtomicLong} instance with a {@code initialValue} that overwrites the existing value at + * {@code redisCounter}. * * @param redisCounter Redis key of this counter. * @param factory connection factory. - * @param initialValue initial value to set if the Redis key is absent. + * @param initialValue initial value to set. */ public RedisAtomicLong(String redisCounter, RedisConnectionFactory factory, long initialValue) { this(redisCounter, factory, Long.valueOf(initialValue)); @@ -99,7 +100,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe } /** - * Constructs a new {@link RedisAtomicLong} instance. Uses the value existing in Redis or 0 if none is found. + * Constructs a new {@link RedisAtomicLong} instance. Uses the value existing in Redis or {@code 0} if none is found. * * @param redisCounter Redis key of this counter. * @param template the template. @@ -110,7 +111,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe } /** - * Constructs a new {@link RedisAtomicLong} instance. + * Constructs a new {@link RedisAtomicLong} instance with a {@code initialValue} that overwrites the existing value. *

* Note: You need to configure the given {@code template} with appropriate {@link RedisSerializer} for the key and * value. The key serializer must be able to deserialize to a {@link String} and the value serializer must be able to