All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.activemq.store.kahadb.data.KahaAddMessageCommand Maven / Gradle / Ivy

There is a newer version: 6.1.2
Show newest version
//
// Generated by protoc, do not edit by hand.
//
package org.apache.activemq.store.kahadb.data;


public final class KahaAddMessageCommand extends KahaAddMessageCommandBase implements org.apache.activemq.store.kahadb.JournalCommand {

   public java.util.ArrayList missingFields() {
      java.util.ArrayList missingFields = super.missingFields();
      if(  !hasDestination() ) {
         missingFields.add("destination");
      }
      if(  !hasMessageId() ) {
         missingFields.add("messageId");
      }
      if(  !hasMessage() ) {
         missingFields.add("message");
      }
      if( hasTransactionInfo() ) {
         try {
            getTransactionInfo().assertInitialized();
         } catch (org.apache.activemq.protobuf.UninitializedMessageException e){
            missingFields.addAll(prefix(e.getMissingFields(),"transaction_info."));
         }
      }
      if( hasDestination() ) {
         try {
            getDestination().assertInitialized();
         } catch (org.apache.activemq.protobuf.UninitializedMessageException e){
            missingFields.addAll(prefix(e.getMissingFields(),"destination."));
         }
      }
      return missingFields;
   }

   public void clear() {
      super.clear();
      clearTransactionInfo();
      clearDestination();
      clearMessageId();
      clearMessage();
      clearPriority();
      clearPrioritySupported();
   }

   public KahaAddMessageCommand clone() {
      return new KahaAddMessageCommand().mergeFrom(this);
   }

   public KahaAddMessageCommand mergeFrom(KahaAddMessageCommand other) {
      if (other.hasTransactionInfo()) {
         if (hasTransactionInfo()) {
            getTransactionInfo().mergeFrom(other.getTransactionInfo());
         } else {
            setTransactionInfo(other.getTransactionInfo().clone());
         }
      }
      if (other.hasDestination()) {
         if (hasDestination()) {
            getDestination().mergeFrom(other.getDestination());
         } else {
            setDestination(other.getDestination().clone());
         }
      }
      if (other.hasMessageId()) {
         setMessageId(other.getMessageId());
      }
      if (other.hasMessage()) {
         setMessage(other.getMessage());
      }
      if (other.hasPriority()) {
         setPriority(other.getPriority());
      }
      if (other.hasPrioritySupported()) {
         setPrioritySupported(other.getPrioritySupported());
      }
      return this;
   }

   public int serializedSizeUnframed() {
      if (memoizedSerializedSize != -1)
         return memoizedSerializedSize;

      int size = 0;
      if (hasTransactionInfo()) {
         size += computeMessageSize(1, getTransactionInfo());
      }
      if (hasDestination()) {
         size += computeMessageSize(2, getDestination());
      }
      if (hasMessageId()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(3, getMessageId());
      }
      if (hasMessage()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getMessage());
      }
      if (hasPriority()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(5, getPriority());
      }
      if (hasPrioritySupported()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeBoolSize(6, getPrioritySupported());
      }
      memoizedSerializedSize = size;
      return size;
   }

   public KahaAddMessageCommand 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;
         case 18:
            if (hasDestination()) {
               getDestination().mergeFramed(input);
            } else {
               setDestination(new KahaDestination().mergeFramed(input));
            }
            break;
         case 26:
            setMessageId(input.readString());
            break;
         case 34:
            setMessage(input.readBytes());
            break;
         case 40:
            setPriority(input.readInt32());
            break;
         case 48:
            setPrioritySupported(input.readBool());
            break;
         }
      }
   }
   public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (hasTransactionInfo()) {
         writeMessage(output, 1, getTransactionInfo());
      }
      if (hasDestination()) {
         writeMessage(output, 2, getDestination());
      }
      if (hasMessageId()) {
         output.writeString(3, getMessageId());
      }
      if (hasMessage()) {
         output.writeBytes(4, getMessage());
      }
      if (hasPriority()) {
         output.writeInt32(5, getPriority());
      }
      if (hasPrioritySupported()) {
         output.writeBool(6, getPrioritySupported());
      }
   }

   public static KahaAddMessageCommand parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaAddMessageCommand().mergeUnframed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
      return new KahaAddMessageCommand().mergeUnframed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
      return new KahaAddMessageCommand().mergeUnframed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaAddMessageCommand().mergeUnframed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaAddMessageCommand().mergeFramed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
      return new KahaAddMessageCommand().mergeFramed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
      return new KahaAddMessageCommand().mergeFramed(data).checktInitialized();
   }

   public static KahaAddMessageCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaAddMessageCommand().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");
      }
      if(  hasDestination() ) {
         sb.append(prefix+"destination {\n");
         getDestination().toString(sb, prefix+"  ");
         sb.append(prefix+"}\n");
      }
      if(  hasMessageId() ) {
         sb.append(prefix+"messageId: ");
         sb.append(getMessageId());
         sb.append("\n");
      }
      if(  hasMessage() ) {
         sb.append(prefix+"message: ");
         sb.append(getMessage());
         sb.append("\n");
      }
      if(  hasPriority() ) {
         sb.append(prefix+"priority: ");
         sb.append(getPriority());
         sb.append("\n");
      }
      if(  hasPrioritySupported() ) {
         sb.append(prefix+"prioritySupported: ");
         sb.append(getPrioritySupported());
         sb.append("\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_ADD_MESSAGE_COMMAND;
   }

   public boolean equals(Object obj) {
      if( obj==this )
         return true;
      
      if( obj==null || obj.getClass()!=KahaAddMessageCommand.class )
         return false;
      
      return equals((KahaAddMessageCommand)obj);
   }
   
   public boolean equals(KahaAddMessageCommand obj) {
      if (hasTransactionInfo() ^ obj.hasTransactionInfo() ) 
         return false;
      if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) ))
         return false;
      if (hasDestination() ^ obj.hasDestination() ) 
         return false;
      if (hasDestination() && ( !getDestination().equals(obj.getDestination()) ))
         return false;
      if (hasMessageId() ^ obj.hasMessageId() ) 
         return false;
      if (hasMessageId() && ( !getMessageId().equals(obj.getMessageId()) ))
         return false;
      if (hasMessage() ^ obj.hasMessage() ) 
         return false;
      if (hasMessage() && ( !getMessage().equals(obj.getMessage()) ))
         return false;
      if (hasPriority() ^ obj.hasPriority() ) 
         return false;
      if (hasPriority() && ( getPriority()!=obj.getPriority() ))
         return false;
      if (hasPrioritySupported() ^ obj.hasPrioritySupported() ) 
         return false;
      if (hasPrioritySupported() && ( getPrioritySupported()!=obj.getPrioritySupported() ))
         return false;
      return true;
   }
   
   public int hashCode() {
      int rc=1601475350;
      if (hasTransactionInfo()) {
         rc ^= ( 265667724^getTransactionInfo().hashCode() );
      }
      if (hasDestination()) {
         rc ^= ( 238021614^getDestination().hashCode() );
      }
      if (hasMessageId()) {
         rc ^= ( 563954530^getMessageId().hashCode() );
      }
      if (hasMessage()) {
         rc ^= ( -1675388953^getMessage().hashCode() );
      }
      if (hasPriority()) {
         rc ^= ( -1100816956^getPriority() );
      }
      if (hasPrioritySupported()) {
         rc ^= ( 889475914^ (getPrioritySupported()? 6:-6) );
      }
      return rc;
   }
   
}

abstract class KahaAddMessageCommandBase extends org.apache.activemq.protobuf.BaseMessage {

   // optional 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;
   }

   // required KahaDestination destination = 2;
   private KahaDestination f_destination = null;

   public boolean hasDestination() {
      return this.f_destination!=null;
   }

   public KahaDestination getDestination() {
      if( this.f_destination == null ) {
         this.f_destination = new KahaDestination();
      }
      return this.f_destination;
   }

   public T setDestination(KahaDestination destination) {
      loadAndClear();
      this.f_destination = destination;
      return (T)this;
   }

   public void clearDestination() {
      loadAndClear();
      this.f_destination = null;
   }

   // required string messageId = 3;
   private java.lang.String f_messageId = null;
   private boolean b_messageId;

   public boolean hasMessageId() {
      return this.b_messageId;
   }

   public java.lang.String getMessageId() {
      return this.f_messageId;
   }

   public T setMessageId(java.lang.String messageId) {
      loadAndClear();
      this.b_messageId = true;
      this.f_messageId = messageId;
      return (T)this;
   }

   public void clearMessageId() {
      loadAndClear();
      this.b_messageId = false;
      this.f_messageId = null;
   }

   // required bytes message = 4;
   private org.apache.activemq.protobuf.Buffer f_message = null;
   private boolean b_message;

   public boolean hasMessage() {
      return this.b_message;
   }

   public org.apache.activemq.protobuf.Buffer getMessage() {
      return this.f_message;
   }

   public T setMessage(org.apache.activemq.protobuf.Buffer message) {
      loadAndClear();
      this.b_message = true;
      this.f_message = message;
      return (T)this;
   }

   public void clearMessage() {
      loadAndClear();
      this.b_message = false;
      this.f_message = null;
   }

   // optional int32 priority = 5;
   private int f_priority = 4;
   private boolean b_priority;

   public boolean hasPriority() {
      return this.b_priority;
   }

   public int getPriority() {
      return this.f_priority;
   }

   public T setPriority(int priority) {
      loadAndClear();
      this.b_priority = true;
      this.f_priority = priority;
      return (T)this;
   }

   public void clearPriority() {
      loadAndClear();
      this.b_priority = false;
      this.f_priority = 4;
   }

   // optional bool prioritySupported = 6;
   private boolean f_prioritySupported = false;
   private boolean b_prioritySupported;

   public boolean hasPrioritySupported() {
      return this.b_prioritySupported;
   }

   public boolean getPrioritySupported() {
      return this.f_prioritySupported;
   }

   public T setPrioritySupported(boolean prioritySupported) {
      loadAndClear();
      this.b_prioritySupported = true;
      this.f_prioritySupported = prioritySupported;
      return (T)this;
   }

   public void clearPrioritySupported() {
      loadAndClear();
      this.b_prioritySupported = false;
      this.f_prioritySupported = false;
   }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy