001// 002// Generated by protoc, do not edit by hand. 003// 004package org.apache.activemq.console.command.store.proto; 005 006 007public class QueuePB implements org.fusesource.hawtbuf.proto.PBMessageFactory<QueuePB.Bean, QueuePB.Buffer> { 008 009 public static final QueuePB FACTORY = new QueuePB(); 010 public static final org.fusesource.hawtbuf.proto.PBMessageFramedCodec<Buffer> FRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageFramedCodec<Buffer>(FACTORY); 011 public static final org.fusesource.hawtbuf.proto.PBMessageUnframedCodec<Buffer> UNFRAMED_CODEC = new org.fusesource.hawtbuf.proto.PBMessageUnframedCodec<Buffer>(FACTORY); 012 013 public Bean create() { 014 return new Bean(); 015 } 016 017 public Bean parseUnframed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { 018 return new Bean().mergeUnframed(data); 019 } 020 021 public Bean parseUnframed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { 022 return parseUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(data)); 023 } 024 025 public Buffer parseUnframed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { 026 return new Buffer(data); 027 } 028 029 public Buffer parseUnframed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { 030 return parseUnframed(new org.fusesource.hawtbuf.Buffer(data)); 031 } 032 033 public Buffer parseFramed(org.fusesource.hawtbuf.proto.CodedInputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { 034 int length = data.readRawVarint32(); 035 int oldLimit = data.pushLimit(length); 036 Buffer rc = parseUnframed(data.readRawBytes(length)); 037 data.popLimit(oldLimit); 038 return rc; 039 } 040 041 public Buffer parseFramed(org.fusesource.hawtbuf.Buffer data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { 042 try { 043 org.fusesource.hawtbuf.proto.CodedInputStream input = new org.fusesource.hawtbuf.proto.CodedInputStream(data); 044 Buffer rc = parseFramed(input); 045 input.checkLastTagWas(0); 046 return rc; 047 } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { 048 throw e; 049 } catch (java.io.IOException e) { 050 throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); 051 } 052 } 053 054 public Buffer parseFramed(byte[] data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException { 055 return parseFramed(new org.fusesource.hawtbuf.Buffer(data)); 056 } 057 058 public Buffer parseFramed(java.io.InputStream data) throws org.fusesource.hawtbuf.proto.InvalidProtocolBufferException, java.io.IOException { 059 return parseUnframed(org.fusesource.hawtbuf.proto.MessageBufferSupport.readFrame(data)); 060 } 061 062 public interface Getter extends org.fusesource.hawtbuf.proto.PBMessage<QueuePB.Bean, QueuePB.Buffer> { 063 064 // required int64 key = 1; 065 public boolean hasKey(); 066 public long getKey(); 067 // optional bytes binding_kind = 2; 068 public boolean hasBindingKind(); 069 public org.fusesource.hawtbuf.AsciiBuffer getBindingKind(); 070 // optional bytes binding_data = 3; 071 public boolean hasBindingData(); 072 public org.fusesource.hawtbuf.Buffer getBindingData(); 073 public Bean copy(); 074 public Buffer freeze(); 075 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix); 076 } 077 078 static public final class Bean implements Getter { 079 080 Buffer frozen; 081 Bean bean; 082 083 public Bean() { 084 this.bean = this; 085 } 086 087 public Bean(Bean copy) { 088 this.bean = copy; 089 } 090 091 public Bean copy() { 092 return new Bean(bean); 093 } 094 095 public boolean frozen() { 096 return frozen!=null; 097 } 098 099 public Buffer freeze() { 100 if( frozen==null ) { 101 frozen = new Buffer(bean); 102 assert deepFreeze(); 103 } 104 return frozen; 105 } 106 107 private boolean deepFreeze() { 108 frozen.serializedSizeUnframed(); 109 return true; 110 } 111 112 private void copyCheck() { 113 assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; 114 if (bean != this) { 115 copy(bean); 116 } 117 } 118 119 private void copy(Bean other) { 120 this.bean = this; 121 this.f_key = other.f_key; 122 this.b_key = other.b_key; 123 this.f_bindingKind = other.f_bindingKind; 124 this.f_bindingData = other.f_bindingData; 125 } 126 127 // required int64 key = 1; 128 private long f_key = 0; 129 private boolean b_key; 130 131 public boolean hasKey() { 132 return bean.b_key; 133 } 134 135 public long getKey() { 136 return bean.f_key; 137 } 138 139 public Bean setKey(long key) { 140 copyCheck(); 141 this.b_key = true; 142 this.f_key = key; 143 return this; 144 } 145 146 public void clearKey() { 147 copyCheck(); 148 this.b_key = false; 149 this.f_key = 0; 150 } 151 152 // optional bytes binding_kind = 2; 153 private org.fusesource.hawtbuf.AsciiBuffer f_bindingKind = null; 154 155 public boolean hasBindingKind() { 156 return bean.f_bindingKind!=null; 157 } 158 159 public org.fusesource.hawtbuf.AsciiBuffer getBindingKind() { 160 return bean.f_bindingKind; 161 } 162 163 public Bean setBindingKind(org.fusesource.hawtbuf.AsciiBuffer bindingKind) { 164 copyCheck(); 165 this.f_bindingKind = bindingKind; 166 return this; 167 } 168 169 public void clearBindingKind() { 170 copyCheck(); 171 this.f_bindingKind = null; 172 } 173 174 // optional bytes binding_data = 3; 175 private org.fusesource.hawtbuf.Buffer f_bindingData = null; 176 177 public boolean hasBindingData() { 178 return bean.f_bindingData!=null; 179 } 180 181 public org.fusesource.hawtbuf.Buffer getBindingData() { 182 return bean.f_bindingData; 183 } 184 185 public Bean setBindingData(org.fusesource.hawtbuf.Buffer bindingData) { 186 copyCheck(); 187 this.f_bindingData = bindingData; 188 return this; 189 } 190 191 public void clearBindingData() { 192 copyCheck(); 193 this.f_bindingData = null; 194 } 195 196 public String toString() { 197 return toString(new java.lang.StringBuilder(), "").toString(); 198 } 199 200 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { 201 if( hasKey() ) { 202 sb.append(prefix+"key: "); 203 sb.append(getKey()); 204 sb.append("\n"); 205 } 206 if( hasBindingKind() ) { 207 sb.append(prefix+"binding_kind: "); 208 sb.append(getBindingKind()); 209 sb.append("\n"); 210 } 211 if( hasBindingData() ) { 212 sb.append(prefix+"binding_data: "); 213 sb.append(getBindingData()); 214 sb.append("\n"); 215 } 216 return sb; 217 } 218 219 public Bean mergeUnframed(java.io.InputStream input) throws java.io.IOException { 220 return mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(input)); 221 } 222 223 public Bean mergeUnframed(org.fusesource.hawtbuf.proto.CodedInputStream input) throws java.io.IOException { 224 copyCheck(); 225 while (true) { 226 int tag = input.readTag(); 227 if ((tag & 0x07) == 4) { 228 return this; 229 } 230 switch (tag) { 231 case 0: 232 return this; 233 default: { 234 input.skipField(tag); 235 break; 236 } 237 case 8: 238 setKey(input.readInt64()); 239 break; 240 case 18: 241 setBindingKind(new org.fusesource.hawtbuf.AsciiBuffer(input.readBytes())); 242 break; 243 case 26: 244 setBindingData(input.readBytes()); 245 break; 246 } 247 } 248 } 249 public boolean equals(Object obj) { 250 if( obj==this ) 251 return true; 252 253 if( obj==null || obj.getClass()!=Bean.class ) 254 return false; 255 256 return equals((Bean)obj); 257 } 258 259 public boolean equals(Bean obj) { 260 if (hasKey() ^ obj.hasKey() ) 261 return false; 262 if (hasKey() && ( getKey()!=obj.getKey() )) 263 return false; 264 if (hasBindingKind() ^ obj.hasBindingKind() ) 265 return false; 266 if (hasBindingKind() && ( !getBindingKind().equals(obj.getBindingKind()) )) 267 return false; 268 if (hasBindingData() ^ obj.hasBindingData() ) 269 return false; 270 if (hasBindingData() && ( !getBindingData().equals(obj.getBindingData()) )) 271 return false; 272 return true; 273 } 274 275 public int hashCode() { 276 int rc=2066384; 277 if (hasKey()) { 278 rc ^= ( 75327^(new Long(getKey())).hashCode() ); 279 } 280 if (hasBindingKind()) { 281 rc ^= ( 1382366105^getBindingKind().hashCode() ); 282 } 283 if (hasBindingData()) { 284 rc ^= ( 1382150063^getBindingData().hashCode() ); 285 } 286 return rc; 287 } 288 289 public Bean mergeFrom(Getter other) { 290 copyCheck(); 291 if (other.hasKey()) { 292 setKey(other.getKey()); 293 } 294 if (other.hasBindingKind()) { 295 setBindingKind(other.getBindingKind()); 296 } 297 if (other.hasBindingData()) { 298 setBindingData(other.getBindingData()); 299 } 300 return this; 301 } 302 303 public void clear() { 304 clearKey(); 305 clearBindingKind(); 306 clearBindingData(); 307 } 308 309 public void readExternal(java.io.DataInput in) throws java.io.IOException { 310 assert frozen==null : org.fusesource.hawtbuf.proto.MessageBufferSupport.FORZEN_ERROR_MESSAGE; 311 bean = this; 312 frozen = null; 313 f_key = in.readLong(); 314 b_key = true; 315 { 316 int size = in.readInt(); 317 if( size>=0 ) { 318 byte b[] = new byte[size]; 319 in.readFully(b); 320 f_bindingKind = new org.fusesource.hawtbuf.AsciiBuffer(b); 321 } else { 322 f_bindingKind = null; 323 } 324 } 325 { 326 int size = in.readInt(); 327 if( size>=0 ) { 328 byte b[] = new byte[size]; 329 in.readFully(b); 330 f_bindingData = new org.fusesource.hawtbuf.Buffer(b); 331 } else { 332 f_bindingData = null; 333 } 334 } 335 } 336 337 public void writeExternal(java.io.DataOutput out) throws java.io.IOException { 338 out.writeLong(bean.f_key); 339 if( bean.f_bindingKind!=null ) { 340 out.writeInt(bean.f_bindingKind.getLength()); 341 out.write(bean.f_bindingKind.getData(), bean.f_bindingKind.getOffset(), bean.f_bindingKind.getLength()); 342 } else { 343 out.writeInt(-1); 344 } 345 if( bean.f_bindingData!=null ) { 346 out.writeInt(bean.f_bindingData.getLength()); 347 out.write(bean.f_bindingData.getData(), bean.f_bindingData.getOffset(), bean.f_bindingData.getLength()); 348 } else { 349 out.writeInt(-1); 350 } 351 } 352 353 } 354 355 static public final class Buffer implements org.fusesource.hawtbuf.proto.MessageBuffer<QueuePB.Bean, QueuePB.Buffer>, Getter { 356 357 private Bean bean; 358 private org.fusesource.hawtbuf.Buffer buffer; 359 private int size=-1; 360 private int hashCode; 361 362 private Buffer(org.fusesource.hawtbuf.Buffer buffer) { 363 this.buffer = buffer; 364 } 365 366 private Buffer(Bean bean) { 367 this.bean = bean; 368 } 369 370 public Bean copy() { 371 return bean().copy(); 372 } 373 374 public Buffer freeze() { 375 return this; 376 } 377 378 private Bean bean() { 379 if (bean == null) { 380 try { 381 bean = new Bean().mergeUnframed(new org.fusesource.hawtbuf.proto.CodedInputStream(buffer)); 382 bean.frozen=this; 383 } catch (org.fusesource.hawtbuf.proto.InvalidProtocolBufferException e) { 384 throw new RuntimeException(e); 385 } catch (java.io.IOException e) { 386 throw new RuntimeException("An IOException was thrown (should never happen in this method).", e); 387 } 388 } 389 return bean; 390 } 391 392 public String toString() { 393 return bean().toString(); 394 } 395 396 public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) { 397 return bean().toString(sb, prefix); 398 } 399 400 // required int64 key = 1; 401 public boolean hasKey() { 402 return bean().hasKey(); 403 } 404 405 public long getKey() { 406 return bean().getKey(); 407 } 408 409 // optional bytes binding_kind = 2; 410 public boolean hasBindingKind() { 411 return bean().hasBindingKind(); 412 } 413 414 public org.fusesource.hawtbuf.AsciiBuffer getBindingKind() { 415 return bean().getBindingKind(); 416 } 417 418 // optional bytes binding_data = 3; 419 public boolean hasBindingData() { 420 return bean().hasBindingData(); 421 } 422 423 public org.fusesource.hawtbuf.Buffer getBindingData() { 424 return bean().getBindingData(); 425 } 426 427 public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { 428 if( buffer !=null ) { 429 return buffer; 430 } 431 return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); 432 } 433 434 public org.fusesource.hawtbuf.Buffer toFramedBuffer() { 435 return org.fusesource.hawtbuf.proto.MessageBufferSupport.toFramedBuffer(this); 436 } 437 438 public byte[] toUnframedByteArray() { 439 return toUnframedBuffer().toByteArray(); 440 } 441 442 public byte[] toFramedByteArray() { 443 return toFramedBuffer().toByteArray(); 444 } 445 446 public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { 447 output.writeRawVarint32(serializedSizeUnframed()); 448 writeUnframed(output); 449 } 450 451 public void writeFramed(java.io.OutputStream output) throws java.io.IOException { 452 org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); 453 writeFramed(codedOutput); 454 codedOutput.flush(); 455 } 456 457 public void writeUnframed(java.io.OutputStream output) throws java.io.IOException { 458 org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); 459 writeUnframed(codedOutput); 460 codedOutput.flush(); 461 } 462 463 public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { 464 if (buffer == null) { 465 int size = serializedSizeUnframed(); 466 buffer = output.getNextBuffer(size); 467 org.fusesource.hawtbuf.proto.CodedOutputStream original=null; 468 if( buffer == null ) { 469 buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); 470 original = output; 471 output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); 472 } 473 output.writeInt64(1, bean.getKey()); 474 if (bean.hasBindingKind()) { 475 output.writeBytes(2, bean.getBindingKind()); 476 } 477 if (bean.hasBindingData()) { 478 output.writeBytes(3, bean.getBindingData()); 479 } 480 if( original !=null ) { 481 output.checkNoSpaceLeft(); 482 output = original; 483 output.writeRawBytes(buffer); 484 } 485 } else { 486 output.writeRawBytes(buffer); 487 } 488 } 489 490 public int serializedSizeFramed() { 491 int t = serializedSizeUnframed(); 492 return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; 493 } 494 495 public int serializedSizeUnframed() { 496 if (buffer != null) { 497 return buffer.length; 498 } 499 if (size != -1) 500 return size; 501 502 size = 0; 503 size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getKey()); 504 if (hasBindingKind()) { 505 size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getBindingKind()); 506 } 507 if (hasBindingData()) { 508 size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getBindingData()); 509 } 510 return size; 511 } 512 513 public boolean equals(Object obj) { 514 if( obj==this ) 515 return true; 516 517 if( obj==null || obj.getClass()!=Buffer.class ) 518 return false; 519 520 return equals((Buffer)obj); 521 } 522 523 public boolean equals(Buffer obj) { 524 return toUnframedBuffer().equals(obj.toUnframedBuffer()); 525 } 526 527 public int hashCode() { 528 if( hashCode==0 ) { 529 hashCode=2000715872 ^ toUnframedBuffer().hashCode(); 530 } 531 return hashCode; 532 } 533 534 public boolean frozen() { 535 return true; 536 } 537 } 538 539} 540