
com.github.brainlag.nsq.frames.NSQFrame Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nsq-client Show documentation
Show all versions of nsq-client Show documentation
Fast Java client for NSQ.
The newest version!
package com.github.brainlag.nsq.frames;
public abstract class NSQFrame {
private int size;
private byte[] data;
public static NSQFrame instance(int type) {
switch (type) {
case 0 :
return new ResponseFrame();
case 1 :
return new ErrorFrame();
case 2 :
return new MessageFrame();
}
return null;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
}