Refactores primitive types in the API. Now int -> Integer and double -> Double.

This is to support Redis null values
This commit is contained in:
Jonathan Leibiusky
2010-09-15 14:41:35 -03:00
parent a9d8dfe3d7
commit ed20894c95
9 changed files with 140 additions and 135 deletions

View File

@@ -1,15 +1,15 @@
package redis.clients.jedis;
import redis.clients.util.RedisInputStream;
import redis.clients.util.RedisOutputStream;
import java.io.*;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import redis.clients.util.RedisInputStream;
import redis.clients.util.RedisOutputStream;
public class Connection {
private String host;
private int port = Protocol.DEFAULT_PORT;
@@ -50,13 +50,13 @@ public class Connection {
}
protected Connection sendCommand(String name, String... args) {
try {
connect();
} catch (UnknownHostException e) {
throw new JedisException("Could not connect to redis-server", e);
} catch (IOException e) {
throw new JedisException("Could not connect to redis-server", e);
}
try {
connect();
} catch (UnknownHostException e) {
throw new JedisException("Could not connect to redis-server", e);
} catch (IOException e) {
throw new JedisException("Could not connect to redis-server", e);
}
protocol.sendCommand(outputStream, name, args);
pipelinedCommands++;
return this;
@@ -126,9 +126,9 @@ public class Connection {
return (String) protocol.read(inputStream);
}
public int getIntegerReply() {
public Integer getIntegerReply() {
pipelinedCommands--;
return ((Integer) protocol.read(inputStream)).intValue();
return (Integer) protocol.read(inputStream);
}
@SuppressWarnings("unchecked")