org.apache.activemq.leveldb.record.SubscriptionRecord Maven / Gradle / Ivy
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.leveldb.record;
public class SubscriptionRecord implements org.fusesource.hawtbuf.proto.PBMessageFactory {
public static final SubscriptionRecord FACTORY = new SubscriptionRecord();
public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec(FACTORY);
public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec(FACTORY);
public Bean create() {
return new Bean();
}
public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
return new Bean().mergeUnframed(data);
}
public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data));
}
public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
return new Buffer(data);
}
public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
return parseUnframed(new org.fusesource.hawtbuf.Buffer(data));
}
public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
int length = data.readRawVarint32();
int oldLimit = data.pushLimit(length);
Buffer rc = parseUnframed(data.readRawBytes(length));
data.popLimit(oldLimit);
return rc;
}
public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
try {
org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data);
Buffer rc = parseFramed(input);
input.checkLastTagWas(0);
return rc;
} catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
throw e;
} catch (java.io.IOException e) {
throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
}
}
public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException {
return parseFramed(new org.fusesource.hawtbuf.Buffer(data));
}
public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException {
return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data));
}
public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage {
// optional int64 topic_key = 1;
public boolean hasTopicKey();
public long getTopicKey();
// optional string client_id = 2;
public boolean hasClientId();
public java.lang.String getClientId();
// optional string subscription_name = 3;
public boolean hasSubscriptionName();
public java.lang.String getSubscriptionName();
// optional string selector = 4;
public boolean hasSelector();
public java.lang.String getSelector();
// optional string destination_name = 5;
public boolean hasDestinationName();
public java.lang.String getDestinationName();
// optional string subscribed_destination_name = 6;
public boolean hasSubscribedDestinationName();
public java.lang.String getSubscribedDestinationName();
public Bean copy();
public Buffer freeze();
public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix);
}
static public final class Bean implements Getter {
Buffer frozen;
Bean bean;
public Bean() {
this.bean = this;
}
public Bean(Bean copy) {
this.bean = copy;
}
public Bean copy() {
return new Bean(bean);
}
public boolean frozen() {
return frozen!=null;
}
public Buffer freeze() {
if( frozen==null ) {
frozen = new Buffer(bean);
assert deepFreeze();
}
return frozen;
}
private boolean deepFreeze() {
frozen.serializedSizeUnframed();
return true;
}
private void copyCheck() {
assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
if (bean != this) {
copy(bean);
}
}
private void copy(Bean other) {
this.bean = this;
this.f_topicKey = other.f_topicKey;
this.b_topicKey = other.b_topicKey;
this.f_clientId = other.f_clientId;
this.f_subscriptionName = other.f_subscriptionName;
this.f_selector = other.f_selector;
this.f_destinationName = other.f_destinationName;
this.f_subscribedDestinationName = other.f_subscribedDestinationName;
}
// optional int64 topic_key = 1;
private long f_topicKey = 0;
private boolean b_topicKey;
public boolean hasTopicKey() {
return bean.b_topicKey;
}
public long getTopicKey() {
return bean.f_topicKey;
}
public Bean setTopicKey(long topicKey) {
copyCheck();
this.b_topicKey = true;
this.f_topicKey = topicKey;
return this;
}
public void clearTopicKey() {
copyCheck();
this.b_topicKey = false;
this.f_topicKey = 0;
}
// optional string client_id = 2;
private java.lang.String f_clientId = null;
public boolean hasClientId() {
return bean.f_clientId!=null;
}
public java.lang.String getClientId() {
return bean.f_clientId;
}
public Bean setClientId(java.lang.String clientId) {
copyCheck();
this.f_clientId = clientId;
return this;
}
public void clearClientId() {
copyCheck();
this.f_clientId = null;
}
// optional string subscription_name = 3;
private java.lang.String f_subscriptionName = null;
public boolean hasSubscriptionName() {
return bean.f_subscriptionName!=null;
}
public java.lang.String getSubscriptionName() {
return bean.f_subscriptionName;
}
public Bean setSubscriptionName(java.lang.String subscriptionName) {
copyCheck();
this.f_subscriptionName = subscriptionName;
return this;
}
public void clearSubscriptionName() {
copyCheck();
this.f_subscriptionName = null;
}
// optional string selector = 4;
private java.lang.String f_selector = null;
public boolean hasSelector() {
return bean.f_selector!=null;
}
public java.lang.String getSelector() {
return bean.f_selector;
}
public Bean setSelector(java.lang.String selector) {
copyCheck();
this.f_selector = selector;
return this;
}
public void clearSelector() {
copyCheck();
this.f_selector = null;
}
// optional string destination_name = 5;
private java.lang.String f_destinationName = null;
public boolean hasDestinationName() {
return bean.f_destinationName!=null;
}
public java.lang.String getDestinationName() {
return bean.f_destinationName;
}
public Bean setDestinationName(java.lang.String destinationName) {
copyCheck();
this.f_destinationName = destinationName;
return this;
}
public void clearDestinationName() {
copyCheck();
this.f_destinationName = null;
}
// optional string subscribed_destination_name = 6;
private java.lang.String f_subscribedDestinationName = null;
public boolean hasSubscribedDestinationName() {
return bean.f_subscribedDestinationName!=null;
}
public java.lang.String getSubscribedDestinationName() {
return bean.f_subscribedDestinationName;
}
public Bean setSubscribedDestinationName(java.lang.String subscribedDestinationName) {
copyCheck();
this.f_subscribedDestinationName = subscribedDestinationName;
return this;
}
public void clearSubscribedDestinationName() {
copyCheck();
this.f_subscribedDestinationName = null;
}
public String toString() {
return toString(new java.lang.StringBuilder(), "").toString();
}
public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
if( hasTopicKey() ) {
sb.append(prefix+"topic_key: ");
sb.append(getTopicKey());
sb.append("\n");
}
if( hasClientId() ) {
sb.append(prefix+"client_id: ");
sb.append(getClientId());
sb.append("\n");
}
if( hasSubscriptionName() ) {
sb.append(prefix+"subscription_name: ");
sb.append(getSubscriptionName());
sb.append("\n");
}
if( hasSelector() ) {
sb.append(prefix+"selector: ");
sb.append(getSelector());
sb.append("\n");
}
if( hasDestinationName() ) {
sb.append(prefix+"destination_name: ");
sb.append(getDestinationName());
sb.append("\n");
}
if( hasSubscribedDestinationName() ) {
sb.append(prefix+"subscribed_destination_name: ");
sb.append(getSubscribedDestinationName());
sb.append("\n");
}
return sb;
}
public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException {
return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input));
}
public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException {
copyCheck();
while (true) {
int tag = input.readTag();
if ((tag & 0x07) == 4) {
return this;
}
switch (tag) {
case 0:
return this;
default: {
input.skipField(tag);
break;
}
case 8:
setTopicKey(input.readInt64());
break;
case 18:
setClientId(input.readString());
break;
case 26:
setSubscriptionName(input.readString());
break;
case 34:
setSelector(input.readString());
break;
case 42:
setDestinationName(input.readString());
break;
case 50:
setSubscribedDestinationName(input.readString());
break;
}
}
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=Bean.class )
return false;
return equals((Bean)obj);
}
public boolean equals(Bean obj) {
if (hasTopicKey() ^ obj.hasTopicKey() )
return false;
if (hasTopicKey() && ( getTopicKey()!=obj.getTopicKey() ))
return false;
if (hasClientId() ^ obj.hasClientId() )
return false;
if (hasClientId() && ( !getClientId().equals(obj.getClientId()) ))
return false;
if (hasSubscriptionName() ^ obj.hasSubscriptionName() )
return false;
if (hasSubscriptionName() && ( !getSubscriptionName().equals(obj.getSubscriptionName()) ))
return false;
if (hasSelector() ^ obj.hasSelector() )
return false;
if (hasSelector() && ( !getSelector().equals(obj.getSelector()) ))
return false;
if (hasDestinationName() ^ obj.hasDestinationName() )
return false;
if (hasDestinationName() && ( !getDestinationName().equals(obj.getDestinationName()) ))
return false;
if (hasSubscribedDestinationName() ^ obj.hasSubscribedDestinationName() )
return false;
if (hasSubscribedDestinationName() && ( !getSubscribedDestinationName().equals(obj.getSubscribedDestinationName()) ))
return false;
return true;
}
public int hashCode() {
int rc=2066384;
if (hasTopicKey()) {
rc ^= ( -892667184^(new Long(getTopicKey())).hashCode() );
}
if (hasClientId()) {
rc ^= ( 973052518^getClientId().hashCode() );
}
if (hasSubscriptionName()) {
rc ^= ( -1358711448^getSubscriptionName().hashCode() );
}
if (hasSelector()) {
rc ^= ( 1256216575^getSelector().hashCode() );
}
if (hasDestinationName()) {
rc ^= ( 1535194009^getDestinationName().hashCode() );
}
if (hasSubscribedDestinationName()) {
rc ^= ( -924694561^getSubscribedDestinationName().hashCode() );
}
return rc;
}
public Bean mergeFrom(Getter other) {
copyCheck();
if (other.hasTopicKey()) {
setTopicKey(other.getTopicKey());
}
if (other.hasClientId()) {
setClientId(other.getClientId());
}
if (other.hasSubscriptionName()) {
setSubscriptionName(other.getSubscriptionName());
}
if (other.hasSelector()) {
setSelector(other.getSelector());
}
if (other.hasDestinationName()) {
setDestinationName(other.getDestinationName());
}
if (other.hasSubscribedDestinationName()) {
setSubscribedDestinationName(other.getSubscribedDestinationName());
}
return this;
}
public void clear() {
clearTopicKey();
clearClientId();
clearSubscriptionName();
clearSelector();
clearDestinationName();
clearSubscribedDestinationName();
}
public void readExternal(java.io.DataInput in) throws java.io.IOException {
assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
bean = this;
frozen = null;
f_topicKey = in.readLong();
b_topicKey = true;
if( in.readBoolean() ) {
f_clientId = in.readUTF();
} else {
f_clientId = null;
}
if( in.readBoolean() ) {
f_subscriptionName = in.readUTF();
} else {
f_subscriptionName = null;
}
if( in.readBoolean() ) {
f_selector = in.readUTF();
} else {
f_selector = null;
}
if( in.readBoolean() ) {
f_destinationName = in.readUTF();
} else {
f_destinationName = null;
}
if( in.readBoolean() ) {
f_subscribedDestinationName = in.readUTF();
} else {
f_subscribedDestinationName = null;
}
}
public void writeExternal(java.io.DataOutput out) throws java.io.IOException {
out.writeLong(bean.f_topicKey);
if( bean.f_clientId!=null ) {
out.writeBoolean(true);
out.writeUTF(bean.f_clientId);
} else {
out.writeBoolean(false);
}
if( bean.f_subscriptionName!=null ) {
out.writeBoolean(true);
out.writeUTF(bean.f_subscriptionName);
} else {
out.writeBoolean(false);
}
if( bean.f_selector!=null ) {
out.writeBoolean(true);
out.writeUTF(bean.f_selector);
} else {
out.writeBoolean(false);
}
if( bean.f_destinationName!=null ) {
out.writeBoolean(true);
out.writeUTF(bean.f_destinationName);
} else {
out.writeBoolean(false);
}
if( bean.f_subscribedDestinationName!=null ) {
out.writeBoolean(true);
out.writeUTF(bean.f_subscribedDestinationName);
} else {
out.writeBoolean(false);
}
}
}
static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer, Getter {
private Bean bean;
private org.fusesource.hawtbuf.Buffer buffer;
private int size=-1;
private int hashCode;
private Buffer(org.fusesource.hawtbuf.Buffer buffer) {
this.buffer = buffer;
}
private Buffer(Bean bean) {
this.bean = bean;
}
public Bean copy() {
return bean().copy();
}
public Buffer freeze() {
return this;
}
private Bean bean() {
if (bean == null) {
try {
bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer));
bean.frozen=this;
} catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) {
throw new RuntimeException(e);
} catch (java.io.IOException e) {
throw new RuntimeException("An IOException was thrown (should never happen in this method).", e);
}
}
return bean;
}
public String toString() {
return bean().toString();
}
public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
return bean().toString(sb, prefix);
}
// optional int64 topic_key = 1;
public boolean hasTopicKey() {
return bean().hasTopicKey();
}
public long getTopicKey() {
return bean().getTopicKey();
}
// optional string client_id = 2;
public boolean hasClientId() {
return bean().hasClientId();
}
public java.lang.String getClientId() {
return bean().getClientId();
}
// optional string subscription_name = 3;
public boolean hasSubscriptionName() {
return bean().hasSubscriptionName();
}
public java.lang.String getSubscriptionName() {
return bean().getSubscriptionName();
}
// optional string selector = 4;
public boolean hasSelector() {
return bean().hasSelector();
}
public java.lang.String getSelector() {
return bean().getSelector();
}
// optional string destination_name = 5;
public boolean hasDestinationName() {
return bean().hasDestinationName();
}
public java.lang.String getDestinationName() {
return bean().getDestinationName();
}
// optional string subscribed_destination_name = 6;
public boolean hasSubscribedDestinationName() {
return bean().hasSubscribedDestinationName();
}
public java.lang.String getSubscribedDestinationName() {
return bean().getSubscribedDestinationName();
}
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() {
if( buffer !=null ) {
return buffer;
}
return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this);
}
public org.fusesource.hawtbuf.Buffer toFramedBuffer() {
return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this);
}
public byte[] toUnframedByteArray() {
return toUnframedBuffer().toByteArray();
}
public byte[] toFramedByteArray() {
return toFramedBuffer().toByteArray();
}
public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
output.writeRawVarint32(serializedSizeUnframed());
writeUnframed(output);
}
public void writeFramed(java.io.OutputStream output) throws java.io.IOException {
org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
writeFramed(codedOutput);
codedOutput.flush();
}
public void writeUnframed(java.io.OutputStream output) throws java.io.IOException {
org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output);
writeUnframed(codedOutput);
codedOutput.flush();
}
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException {
if (buffer == null) {
int size = serializedSizeUnframed();
buffer = output.getNextBuffer(size);
org.fusesource.hawtbuf.proto.CodedOutputStream original=null;
if( buffer == null ) {
buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]);
original = output;
output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer);
}
if (bean.hasTopicKey()) {
output.writeInt64(1, bean.getTopicKey());
}
if (bean.hasClientId()) {
output.writeString(2, bean.getClientId());
}
if (bean.hasSubscriptionName()) {
output.writeString(3, bean.getSubscriptionName());
}
if (bean.hasSelector()) {
output.writeString(4, bean.getSelector());
}
if (bean.hasDestinationName()) {
output.writeString(5, bean.getDestinationName());
}
if (bean.hasSubscribedDestinationName()) {
output.writeString(6, bean.getSubscribedDestinationName());
}
if( original !=null ) {
output.checkNoSpaceLeft();
output = original;
output.writeRawBytes(buffer);
}
} else {
output.writeRawBytes(buffer);
}
}
public int serializedSizeFramed() {
int t = serializedSizeUnframed();
return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t;
}
public int serializedSizeUnframed() {
if (buffer != null) {
return buffer.length;
}
if (size != -1)
return size;
size = 0;
if (hasTopicKey()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getTopicKey());
}
if (hasClientId()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(2, getClientId());
}
if (hasSubscriptionName()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(3, getSubscriptionName());
}
if (hasSelector()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(4, getSelector());
}
if (hasDestinationName()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(5, getDestinationName());
}
if (hasSubscribedDestinationName()) {
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(6, getSubscribedDestinationName());
}
return size;
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=Buffer.class )
return false;
return equals((Buffer)obj);
}
public boolean equals(Buffer obj) {
return toUnframedBuffer().equals(obj.toUnframedBuffer());
}
public int hashCode() {
if( hashCode==0 ) {
hashCode=2000715872 ^ toUnframedBuffer().hashCode();
}
return hashCode;
}
public boolean frozen() {
return true;
}
}
}