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

org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand 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 KahaRemoveMessageCommand extends KahaRemoveMessageCommandBase 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( 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();
      clearAck();
      clearSubscriptionKey();
   }

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

   public KahaRemoveMessageCommand mergeFrom(KahaRemoveMessageCommand 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.hasAck()) {
         setAck(other.getAck());
      }
      if (other.hasSubscriptionKey()) {
         setSubscriptionKey(other.getSubscriptionKey());
      }
      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 (hasAck()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getAck());
      }
      if (hasSubscriptionKey()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(5, getSubscriptionKey());
      }
      memoizedSerializedSize = size;
      return size;
   }

   public KahaRemoveMessageCommand 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:
            setAck(input.readBytes());
            break;
         case 42:
            setSubscriptionKey(input.readString());
            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 (hasAck()) {
         output.writeBytes(4, getAck());
      }
      if (hasSubscriptionKey()) {
         output.writeString(5, getSubscriptionKey());
      }
   }

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

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

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

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

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

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

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

   public static KahaRemoveMessageCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaRemoveMessageCommand().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(  hasAck() ) {
         sb.append(prefix+"ack: ");
         sb.append(getAck());
         sb.append("\n");
      }
      if(  hasSubscriptionKey() ) {
         sb.append(prefix+"subscriptionKey: ");
         sb.append(getSubscriptionKey());
         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_REMOVE_MESSAGE_COMMAND;
   }

   public boolean equals(Object obj) {
      if( obj==this )
         return true;
      
      if( obj==null || obj.getClass()!=KahaRemoveMessageCommand.class )
         return false;
      
      return equals((KahaRemoveMessageCommand)obj);
   }
   
   public boolean equals(KahaRemoveMessageCommand 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 (hasAck() ^ obj.hasAck() ) 
         return false;
      if (hasAck() && ( !getAck().equals(obj.getAck()) ))
         return false;
      if (hasSubscriptionKey() ^ obj.hasSubscriptionKey() ) 
         return false;
      if (hasSubscriptionKey() && ( !getSubscriptionKey().equals(obj.getSubscriptionKey()) ))
         return false;
      return true;
   }
   
   public int hashCode() {
      int rc=-64211337;
      if (hasTransactionInfo()) {
         rc ^= ( 265667724^getTransactionInfo().hashCode() );
      }
      if (hasDestination()) {
         rc ^= ( 238021614^getDestination().hashCode() );
      }
      if (hasMessageId()) {
         rc ^= ( 563954530^getMessageId().hashCode() );
      }
      if (hasAck()) {
         rc ^= ( 65641^getAck().hashCode() );
      }
      if (hasSubscriptionKey()) {
         rc ^= ( 1895830498^getSubscriptionKey().hashCode() );
      }
      return rc;
   }
   
}

abstract class KahaRemoveMessageCommandBase 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;
   }

   // optional bytes ack = 4;
   private org.apache.activemq.protobuf.Buffer f_ack = null;
   private boolean b_ack;

   public boolean hasAck() {
      return this.b_ack;
   }

   public org.apache.activemq.protobuf.Buffer getAck() {
      return this.f_ack;
   }

   public T setAck(org.apache.activemq.protobuf.Buffer ack) {
      loadAndClear();
      this.b_ack = true;
      this.f_ack = ack;
      return (T)this;
   }

   public void clearAck() {
      loadAndClear();
      this.b_ack = false;
      this.f_ack = null;
   }

   // optional string subscriptionKey = 5;
   private java.lang.String f_subscriptionKey = null;
   private boolean b_subscriptionKey;

   public boolean hasSubscriptionKey() {
      return this.b_subscriptionKey;
   }

   public java.lang.String getSubscriptionKey() {
      return this.f_subscriptionKey;
   }

   public T setSubscriptionKey(java.lang.String subscriptionKey) {
      loadAndClear();
      this.b_subscriptionKey = true;
      this.f_subscriptionKey = subscriptionKey;
      return (T)this;
   }

   public void clearSubscriptionKey() {
      loadAndClear();
      this.b_subscriptionKey = false;
      this.f_subscriptionKey = null;
   }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy