org.apache.activemq.store.kahadb.data.KahaPrepareCommand Maven / Gradle / Ivy
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.store.kahadb.data;
public final class KahaPrepareCommand extends KahaPrepareCommandBase implements org.apache.activemq.store.kahadb.JournalCommand {
public java.util.ArrayList missingFields() {
java.util.ArrayList missingFields = super.missingFields();
if( !hasTransactionInfo() ) {
missingFields.add("transaction_info");
}
if( hasTransactionInfo() ) {
try {
getTransactionInfo().assertInitialized();
} catch (org.apache.activemq.protobuf.UninitializedMessageException e){
missingFields.addAll(prefix(e.getMissingFields(),"transaction_info."));
}
}
return missingFields;
}
public void clear() {
super.clear();
clearTransactionInfo();
}
public KahaPrepareCommand clone() {
return new KahaPrepareCommand().mergeFrom(this);
}
public KahaPrepareCommand mergeFrom(KahaPrepareCommand other) {
if (other.hasTransactionInfo()) {
if (hasTransactionInfo()) {
getTransactionInfo().mergeFrom(other.getTransactionInfo());
} else {
setTransactionInfo(other.getTransactionInfo().clone());
}
}
return this;
}
public int serializedSizeUnframed() {
if (memoizedSerializedSize != -1)
return memoizedSerializedSize;
int size = 0;
if (hasTransactionInfo()) {
size += computeMessageSize(1, getTransactionInfo());
}
memoizedSerializedSize = size;
return size;
}
public KahaPrepareCommand 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:
if (hasTransactionInfo()) {
getTransactionInfo().mergeFramed(input);
} else {
setTransactionInfo(new KahaTransactionInfo().mergeFramed(input));
}
break;
}
}
}
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
if (hasTransactionInfo()) {
writeMessage(output, 1, getTransactionInfo());
}
}
public static KahaPrepareCommand parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaPrepareCommand().mergeUnframed(data).checktInitialized();
}
public static KahaPrepareCommand parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaPrepareCommand().mergeUnframed(data).checktInitialized();
}
public static KahaPrepareCommand parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaPrepareCommand().mergeUnframed(data).checktInitialized();
}
public static KahaPrepareCommand parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaPrepareCommand().mergeUnframed(data).checktInitialized();
}
public static KahaPrepareCommand parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaPrepareCommand().mergeFramed(data).checktInitialized();
}
public static KahaPrepareCommand parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaPrepareCommand().mergeFramed(data).checktInitialized();
}
public static KahaPrepareCommand parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
return new KahaPrepareCommand().mergeFramed(data).checktInitialized();
}
public static KahaPrepareCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
return new KahaPrepareCommand().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( hasTransactionInfo() ) {
sb.append(prefix+"transaction_info {\n");
getTransactionInfo().toString(sb, prefix+" ");
sb.append(prefix+"}\n");
}
return sb;
}
public void visit(org.apache.activemq.store.kahadb.Visitor visitor) throws java.io.IOException {
visitor.visit(this);
}
public KahaEntryType type() {
return KahaEntryType.KAHA_PREPARE_COMMAND;
}
public boolean equals(Object obj) {
if( obj==this )
return true;
if( obj==null || obj.getClass()!=KahaPrepareCommand.class )
return false;
return equals((KahaPrepareCommand)obj);
}
public boolean equals(KahaPrepareCommand obj) {
if (hasTransactionInfo() ^ obj.hasTransactionInfo() )
return false;
if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) ))
return false;
return true;
}
public int hashCode() {
int rc=-45182189;
if (hasTransactionInfo()) {
rc ^= ( 265667724^getTransactionInfo().hashCode() );
}
return rc;
}
}
abstract class KahaPrepareCommandBase extends org.apache.activemq.protobuf.BaseMessage {
// required KahaTransactionInfo transaction_info = 1;
private KahaTransactionInfo f_transactionInfo = null;
public boolean hasTransactionInfo() {
return this.f_transactionInfo!=null;
}
public KahaTransactionInfo getTransactionInfo() {
if( this.f_transactionInfo == null ) {
this.f_transactionInfo = new KahaTransactionInfo();
}
return this.f_transactionInfo;
}
public T setTransactionInfo(KahaTransactionInfo transactionInfo) {
loadAndClear();
this.f_transactionInfo = transactionInfo;
return (T)this;
}
public void clearTransactionInfo() {
loadAndClear();
this.f_transactionInfo = null;
}
}