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

org.apache.activemq.store.kahadb.data.KahaLocation 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 KahaLocation extends KahaLocationBase {

   public java.util.ArrayList missingFields() {
      java.util.ArrayList missingFields = super.missingFields();
      if(  !hasLogId() ) {
         missingFields.add("log_id");
      }
      if(  !hasOffset() ) {
         missingFields.add("offset");
      }
      return missingFields;
   }

   public void clear() {
      super.clear();
      clearLogId();
      clearOffset();
   }

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

   public KahaLocation mergeFrom(KahaLocation other) {
      if (other.hasLogId()) {
         setLogId(other.getLogId());
      }
      if (other.hasOffset()) {
         setOffset(other.getOffset());
      }
      return this;
   }

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

      int size = 0;
      if (hasLogId()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(1, getLogId());
      }
      if (hasOffset()) {
         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(2, getOffset());
      }
      memoizedSerializedSize = size;
      return size;
   }

   public KahaLocation 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 8:
            setLogId(input.readInt32());
            break;
         case 16:
            setOffset(input.readInt32());
            break;
         }
      }
   }
   public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (hasLogId()) {
         output.writeInt32(1, getLogId());
      }
      if (hasOffset()) {
         output.writeInt32(2, getOffset());
      }
   }

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

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

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

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

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

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

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

   public static KahaLocation parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
      return new KahaLocation().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(  hasLogId() ) {
         sb.append(prefix+"log_id: ");
         sb.append(getLogId());
         sb.append("\n");
      }
      if(  hasOffset() ) {
         sb.append(prefix+"offset: ");
         sb.append(getOffset());
         sb.append("\n");
      }
      return sb;
   }

   public boolean equals(Object obj) {
      if( obj==this )
         return true;
      
      if( obj==null || obj.getClass()!=KahaLocation.class )
         return false;
      
      return equals((KahaLocation)obj);
   }
   
   public boolean equals(KahaLocation obj) {
      if (hasLogId() ^ obj.hasLogId() ) 
         return false;
      if (hasLogId() && ( getLogId()!=obj.getLogId() ))
         return false;
      if (hasOffset() ^ obj.hasOffset() ) 
         return false;
      if (hasOffset() && ( getOffset()!=obj.getOffset() ))
         return false;
      return true;
   }
   
   public int hashCode() {
      int rc=-1935591996;
      if (hasLogId()) {
         rc ^= ( 73595743^getLogId() );
      }
      if (hasOffset()) {
         rc ^= ( -1935912781^getOffset() );
      }
      return rc;
   }
   
}

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

   // required int32 log_id = 1;
   private int f_logId = 0;
   private boolean b_logId;

   public boolean hasLogId() {
      return this.b_logId;
   }

   public int getLogId() {
      return this.f_logId;
   }

   public T setLogId(int logId) {
      loadAndClear();
      this.b_logId = true;
      this.f_logId = logId;
      return (T)this;
   }

   public void clearLogId() {
      loadAndClear();
      this.b_logId = false;
      this.f_logId = 0;
   }

   // required int32 offset = 2;
   private int f_offset = 0;
   private boolean b_offset;

   public boolean hasOffset() {
      return this.b_offset;
   }

   public int getOffset() {
      return this.f_offset;
   }

   public T setOffset(int offset) {
      loadAndClear();
      this.b_offset = true;
      this.f_offset = offset;
      return (T)this;
   }

   public void clearOffset() {
      loadAndClear();
      this.b_offset = false;
      this.f_offset = 0;
   }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy