Add @Override annotations
This commit is contained in:
parent
05883f5523
commit
4cb3bf2c4a
|
@ -27,6 +27,7 @@ public class BulkReply extends Reply {
|
|||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelBuffer os) throws IOException {
|
||||
os.writeByte(MARKER);
|
||||
if (bytes == null) {
|
||||
|
|
|
@ -21,10 +21,6 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Command serialization.
|
||||
* User: sam
|
||||
* Date: 7/27/11
|
||||
* Time: 3:04 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class Command {
|
||||
public static final byte[] ARGS_PREFIX = "*".getBytes();
|
||||
|
|
|
@ -28,6 +28,7 @@ public class ErrorReply extends Reply {
|
|||
this.error = error;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelBuffer os) throws IOException {
|
||||
os.writeByte(MARKER);
|
||||
os.writeBytes(ERR);
|
||||
|
|
|
@ -27,6 +27,7 @@ public class IntegerReply extends Reply {
|
|||
this.integer = integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelBuffer os) throws IOException {
|
||||
os.writeByte(MARKER);
|
||||
os.writeBytes(Command.numAndCRLF(integer));
|
||||
|
|
|
@ -30,6 +30,10 @@ public class MultiBulkReply extends Reply {
|
|||
public MultiBulkReply() {
|
||||
}
|
||||
|
||||
public MultiBulkReply(Object... values) {
|
||||
this.byteArrays = values;
|
||||
}
|
||||
|
||||
public void read(RedisDecoder rd, ChannelBuffer is) throws IOException {
|
||||
// If we attempted to read the size before, skip the '*' and reread it
|
||||
if (size == -1) {
|
||||
|
@ -62,10 +66,7 @@ public class MultiBulkReply extends Reply {
|
|||
}
|
||||
}
|
||||
|
||||
public MultiBulkReply(Object... values) {
|
||||
this.byteArrays = values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelBuffer os) throws IOException {
|
||||
os.writeByte(MARKER);
|
||||
if (byteArrays == null) {
|
||||
|
|
|
@ -28,6 +28,11 @@ import org.jboss.netty.channel.ChannelHandler.Sharable;
|
|||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
/**
|
||||
* {@link SimpleChannelDownstreamHandler} which encodes {@link Command}'s to {@link ChannelBuffer}'s
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Sharable
|
||||
public class RedisEncoder extends SimpleChannelDownstreamHandler {
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ public abstract class Reply {
|
|||
|
||||
public abstract void write(ChannelBuffer os) throws IOException;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
ChannelBuffer channelBuffer = ChannelBuffers.dynamicBuffer();
|
||||
try {
|
||||
|
|
|
@ -26,7 +26,8 @@ public class StatusReply extends Reply {
|
|||
public StatusReply(ChannelBuffer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void write(ChannelBuffer os) throws IOException {
|
||||
os.writeByte(MARKER);
|
||||
os.writeBytes(status);
|
||||
|
|
Loading…
Reference in New Issue
Block a user