001 // 002 // Generated by protoc, do not edit by hand. 003 // 004 package org.apache.activemq.store.kahadb.data; 005 006 007 public final class KahaLocalTransactionId extends KahaLocalTransactionIdBase<KahaLocalTransactionId> { 008 009 public java.util.ArrayList<String> missingFields() { 010 java.util.ArrayList<String> missingFields = super.missingFields(); 011 if( !hasConnectionId() ) { 012 missingFields.add("connection_id"); 013 } 014 if( !hasTransacitonId() ) { 015 missingFields.add("transaciton_id"); 016 } 017 return missingFields; 018 } 019 020 public void clear() { 021 super.clear(); 022 clearConnectionId(); 023 clearTransacitonId(); 024 } 025 026 public KahaLocalTransactionId clone() { 027 return new KahaLocalTransactionId().mergeFrom(this); 028 } 029 030 public KahaLocalTransactionId mergeFrom(KahaLocalTransactionId other) { 031 if (other.hasConnectionId()) { 032 setConnectionId(other.getConnectionId()); 033 } 034 if (other.hasTransacitonId()) { 035 setTransacitonId(other.getTransacitonId()); 036 } 037 return this; 038 } 039 040 public int serializedSizeUnframed() { 041 if (memoizedSerializedSize != -1) 042 return memoizedSerializedSize; 043 044 int size = 0; 045 if (hasConnectionId()) { 046 size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getConnectionId()); 047 } 048 if (hasTransacitonId()) { 049 size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(1, getTransacitonId()); 050 } 051 memoizedSerializedSize = size; 052 return size; 053 } 054 055 public KahaLocalTransactionId mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException { 056 while (true) { 057 int tag = input.readTag(); 058 if ((tag & 0x07) == 4) { 059 return this; 060 } 061 switch (tag) { 062 case 0: 063 return this; 064 default: { 065 break; 066 } 067 case 10: 068 setConnectionId(input.readString()); 069 break; 070 case 8: 071 setTransacitonId(input.readInt64()); 072 break; 073 } 074 } 075 } 076 public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { 077 if (hasConnectionId()) { 078 output.writeString(1, getConnectionId()); 079 } 080 if (hasTransacitonId()) { 081 output.writeInt64(1, getTransacitonId()); 082 } 083 } 084 085 public static KahaLocalTransactionId parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { 086 return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized(); 087 } 088 089 public static KahaLocalTransactionId parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { 090 return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized(); 091 } 092 093 public static KahaLocalTransactionId parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { 094 return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized(); 095 } 096 097 public static KahaLocalTransactionId parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { 098 return new KahaLocalTransactionId().mergeUnframed(data).checktInitialized(); 099 } 100 101 public static KahaLocalTransactionId parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { 102 return new KahaLocalTransactionId().mergeFramed(data).checktInitialized(); 103 } 104 105 public static KahaLocalTransactionId parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { 106 return new KahaLocalTransactionId().mergeFramed(data).checktInitialized(); 107 } 108 109 public static KahaLocalTransactionId parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { 110 return new KahaLocalTransactionId().mergeFramed(data).checktInitialized(); 111 } 112 113 public static KahaLocalTransactionId parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { 114 return new KahaLocalTransactionId().mergeFramed(data).checktInitialized(); 115 } 116 117 public String toString() { 118 return toString(new java.lang.StringBuilder(), "").toString(); 119 } 120 121 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { 122 if( hasConnectionId() ) { 123 sb.append(prefix+"connection_id: "); 124 sb.append(getConnectionId()); 125 sb.append("\n"); 126 } 127 if( hasTransacitonId() ) { 128 sb.append(prefix+"transaciton_id: "); 129 sb.append(getTransacitonId()); 130 sb.append("\n"); 131 } 132 return sb; 133 } 134 135 public boolean equals(Object obj) { 136 if( obj==this ) 137 return true; 138 139 if( obj==null || obj.getClass()!=KahaLocalTransactionId.class ) 140 return false; 141 142 return equals((KahaLocalTransactionId)obj); 143 } 144 145 public boolean equals(KahaLocalTransactionId obj) { 146 if (hasConnectionId() ^ obj.hasConnectionId() ) 147 return false; 148 if (hasConnectionId() && ( !getConnectionId().equals(obj.getConnectionId()) )) 149 return false; 150 if (hasTransacitonId() ^ obj.hasTransacitonId() ) 151 return false; 152 if (hasTransacitonId() && ( getTransacitonId()!=obj.getTransacitonId() )) 153 return false; 154 return true; 155 } 156 157 public int hashCode() { 158 int rc=1725637181; 159 if (hasConnectionId()) { 160 rc ^= ( 2087427257^getConnectionId().hashCode() ); 161 } 162 if (hasTransacitonId()) { 163 rc ^= ( 942440495^(new Long(getTransacitonId())).hashCode() ); 164 } 165 return rc; 166 } 167 168 } 169 170 abstract class KahaLocalTransactionIdBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> { 171 172 // required string connection_id = 1; 173 private java.lang.String f_connectionId = null; 174 private boolean b_connectionId; 175 176 public boolean hasConnectionId() { 177 return this.b_connectionId; 178 } 179 180 public java.lang.String getConnectionId() { 181 return this.f_connectionId; 182 } 183 184 public T setConnectionId(java.lang.String connectionId) { 185 loadAndClear(); 186 this.b_connectionId = true; 187 this.f_connectionId = connectionId; 188 return (T)this; 189 } 190 191 public void clearConnectionId() { 192 loadAndClear(); 193 this.b_connectionId = false; 194 this.f_connectionId = null; 195 } 196 197 // required int64 transaciton_id = 1; 198 private long f_transacitonId = 0; 199 private boolean b_transacitonId; 200 201 public boolean hasTransacitonId() { 202 return this.b_transacitonId; 203 } 204 205 public long getTransacitonId() { 206 return this.f_transacitonId; 207 } 208 209 public T setTransacitonId(long transacitonId) { 210 loadAndClear(); 211 this.b_transacitonId = true; 212 this.f_transacitonId = transacitonId; 213 return (T)this; 214 } 215 216 public void clearTransacitonId() { 217 loadAndClear(); 218 this.b_transacitonId = false; 219 this.f_transacitonId = 0; 220 } 221 222 } 223