org.apache.activemq.store.kahadb.data.KahaLocalTransactionId Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activemq-osgi Show documentation
Show all versions of activemq-osgi Show documentation
Puts together an ActiveMQ OSGi bundle
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.store.kahadb.data;
public final class KahaLocalTransactionId extends KahaLocalTransactionIdBase {
public java.util.ArrayList missingFields() {
java.util.ArrayList missingFields = super.missingFields();
if( !hasConnectionId() ) {
missingFields.add("connection_id");
}
if( !hasTransactionId() ) {
missingFields.add("transaction_id");
}
return missingFields;
}
public void clear() {
super.clear();
clearConnectionId();
clearTransactionId();
}
public KahaLocalTransactionId clone() {
return new KahaLocalTransactionId().mergeFrom(this);
}
public KahaLocalTransactionId mergeFrom(KahaLocalTransactionId other) {
if (other.hasConnectionId()) {
setConnectionId(other.getConnectionId());
}
if (other.hasTransactionId()) {
setTransactionId(other.getTransactionId());
}
return this;
}
public int serializedSizeUnframed() {
if (memoizedSerializedSize != -1)
return memoizedSerializedSize;
int size = 0;
if (hasConnectionId()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getConnectionId());
}
if (hasTransactionId()) {
size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(1, getTransactionId());
}
memoizedSerializedSize = size;
return size;
}
public KahaLocalTransactionId mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
while (true) {
int tag = input.readTag();
if ((tag & 0x07) == 4) {
return this;
}
switch (tag) {
case 0:
return this;
default: {
break;
}
case 10:
setConnectionId(input.readString());
break;
case 8:
setTransactionId(input.readInt64());
break;
}
}
}
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
if (hasConnectionId()) {
output.writeString(1, getConnectionId());
}
if (hasTransactionId()) {
output.writeInt64(1, getTransactionId());
}
}
public static KahaLocalTransactionId parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized();
}
public static KahaLocalTransactionId parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized();
}
public static KahaLocalTransactionId parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized();
}
public static KahaLocalTransactionId parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized();
}
public static KahaLocalTransactionId parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaLocalTransactionId().mergeFramed(data).checktInitialized();
}
public static KahaLocalTransactionId parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaLocalTransactionId().mergeFramed(data).checktInitialized();
}
public static KahaLocalTransactionId parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaLocalTransactionId().mergeFramed(data).checktInitialized();
}
public static KahaLocalTransactionId parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaLocalTransactionId().mergeFramed(data).checktInitialized();
}
public String toString() {
return toString(new java.lang.StringBuilder(), "").toString();
}
public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
if( hasConnectionId() ) {
sb.append(prefix+"connection_id: ");
sb.append(getConnectionId());
sb.append("\n");
}
if( hasTransactionId() ) {
sb.append(prefix+"transaction_id: ");
sb.append(getTransactionId());
sb.append("\n");
}
return sb;
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=KahaLocalTransactionId.class )
return false;
return equals((KahaLocalTransactionId)obj);
}
public boolean equals(KahaLocalTransactionId obj) {
if (hasConnectionId() ^ obj.hasConnectionId() )
return false;
if (hasConnectionId() && ( !getConnectionId().equals(obj.getConnectionId()) ))
return false;
if (hasTransactionId() ^ obj.hasTransactionId() )
return false;
if (hasTransactionId() && ( getTransactionId()!=obj.getTransactionId() ))
return false;
return true;
}
public int hashCode() {
int rc=1725637181;
if (hasConnectionId()) {
rc ^= ( 2087427257^getConnectionId().hashCode() );
}
if (hasTransactionId()) {
rc ^= ( 1247202425^(new Long(getTransactionId())).hashCode() );
}
return rc;
}
}
abstract class KahaLocalTransactionIdBase extends org.apache.activemq.protobuf.BaseMessage {
// required string connection_id = 1;
private java.lang.String f_connectionId = null;
private boolean b_connectionId;
public boolean hasConnectionId() {
return this.b_connectionId;
}
public java.lang.String getConnectionId() {
return this.f_connectionId;
}
public T setConnectionId(java.lang.String connectionId) {
loadAndClear();
this.b_connectionId = true;
this.f_connectionId = connectionId;
return (T)this;
}
public void clearConnectionId() {
loadAndClear();
this.b_connectionId = false;
this.f_connectionId = null;
}
// required int64 transaction_id = 1;
private long f_transactionId = 0;
private boolean b_transactionId;
public boolean hasTransactionId() {
return this.b_transactionId;
}
public long getTransactionId() {
return this.f_transactionId;
}
public T setTransactionId(long transactionId) {
loadAndClear();
this.b_transactionId = true;
this.f_transactionId = transactionId;
return (T)this;
}
public void clearTransactionId() {
loadAndClear();
this.b_transactionId = false;
this.f_transactionId = 0;
}
}