+ add backward compatible constructors

This commit is contained in:
Costin Leau
2010-11-08 16:04:52 +02:00
parent 9eb8475c57
commit 75341a7bba

View File

@@ -33,9 +33,27 @@ public class RedisAtomicInteger extends Number implements Serializable {
private final String key;
private RedisCommands commands;
/**
* Constructs a new <code>RedisAtomicInteger</code> instance with an initial value of zero.
*
* @param redisCounter
* @param commands
*/
public RedisAtomicInteger(String redisCounter, RedisCommands commands) {
this(redisCounter, commands, 0);
}
/**
* Constructs a new <code>RedisAtomicInteger</code> instance with the given initial value.
*
* @param redisCounter
* @param commands
* @param value
*/
public RedisAtomicInteger(String redisCounter, RedisCommands commands, int value) {
this.key = redisCounter;
this.commands = commands;
commands.set(redisCounter, Integer.toString(value));
}
/**