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

org.apache.activemq.store.kahadb.data.KahaTraceCommand 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 KahaTraceCommand extends KahaTraceCommandBase implements org.apache.activemq.store.kahadb.JournalCommand {

   public java.util.ArrayList missingFields() {
      java.util.ArrayList missingFields = super.missingFields();
      if(  !hasMessage() ) {
         missingFields.add("message");
      }
      return missingFields;
   }

   public void clear() {
      super.clear();
      clearMessage();
   }

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

   public KahaTraceCommand mergeFrom(KahaTraceCommand other) {
      if (other.hasMessage()) {
         setMessage(other.getMessage());
      }
      return this;
   }

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

      int size = 0;
      if (hasMessage()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getMessage());
      }
      memoizedSerializedSize = size;
      return size;
   }

   public KahaTraceCommand 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:
            setMessage(input.readString());
            break;
         }
      }
   }
   public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (hasMessage()) {
         output.writeString(1, getMessage());
      }
   }

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

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

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

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

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

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

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

   public static KahaTraceCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaTraceCommand().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(  hasMessage() ) {
         sb.append(prefix+"message: ");
         sb.append(getMessage());
         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_TRACE_COMMAND;
   }

   public boolean equals(Object obj) {
      if( obj==this )
         return true;
      
      if( obj==null || obj.getClass()!=KahaTraceCommand.class )
         return false;
      
      return equals((KahaTraceCommand)obj);
   }
   
   public boolean equals(KahaTraceCommand obj) {
      if (hasMessage() ^ obj.hasMessage() ) 
         return false;
      if (hasMessage() && ( !getMessage().equals(obj.getMessage()) ))
         return false;
      return true;
   }
   
   public int hashCode() {
      int rc=-1782549291;
      if (hasMessage()) {
         rc ^= ( -1675388953^getMessage().hashCode() );
      }
      return rc;
   }
   
}

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

   // required string message = 1;
   private java.lang.String f_message = null;
   private boolean b_message;

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

   public java.lang.String getMessage() {
      return this.f_message;
   }

   public T setMessage(java.lang.String 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;
   }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy