001//
002// Generated by protoc, do not edit by hand.
003//
004package org.apache.activemq.store.kahadb.data;
005
006
007public final class KahaAddScheduledJobCommand extends KahaAddScheduledJobCommandBase<KahaAddScheduledJobCommand> implements org.apache.activemq.store.kahadb.JournalCommand<KahaAddScheduledJobCommand> {
008
009   public java.util.ArrayList<String> missingFields() {
010      java.util.ArrayList<String> missingFields = super.missingFields();
011      if(  !hasScheduler() ) {
012         missingFields.add("scheduler");
013      }
014      if(  !hasJobId() ) {
015         missingFields.add("job_id");
016      }
017      if(  !hasStartTime() ) {
018         missingFields.add("start_time");
019      }
020      if(  !hasCronEntry() ) {
021         missingFields.add("cron_entry");
022      }
023      if(  !hasDelay() ) {
024         missingFields.add("delay");
025      }
026      if(  !hasPeriod() ) {
027         missingFields.add("period");
028      }
029      if(  !hasRepeat() ) {
030         missingFields.add("repeat");
031      }
032      if(  !hasPayload() ) {
033         missingFields.add("payload");
034      }
035      if(  !hasNextExecutionTime() ) {
036         missingFields.add("next_execution_time");
037      }
038      return missingFields;
039   }
040
041   public void clear() {
042      super.clear();
043      clearScheduler();
044      clearJobId();
045      clearStartTime();
046      clearCronEntry();
047      clearDelay();
048      clearPeriod();
049      clearRepeat();
050      clearPayload();
051      clearNextExecutionTime();
052   }
053
054   public KahaAddScheduledJobCommand clone() {
055      return new KahaAddScheduledJobCommand().mergeFrom(this);
056   }
057
058   public KahaAddScheduledJobCommand mergeFrom(KahaAddScheduledJobCommand other) {
059      if (other.hasScheduler()) {
060         setScheduler(other.getScheduler());
061      }
062      if (other.hasJobId()) {
063         setJobId(other.getJobId());
064      }
065      if (other.hasStartTime()) {
066         setStartTime(other.getStartTime());
067      }
068      if (other.hasCronEntry()) {
069         setCronEntry(other.getCronEntry());
070      }
071      if (other.hasDelay()) {
072         setDelay(other.getDelay());
073      }
074      if (other.hasPeriod()) {
075         setPeriod(other.getPeriod());
076      }
077      if (other.hasRepeat()) {
078         setRepeat(other.getRepeat());
079      }
080      if (other.hasPayload()) {
081         setPayload(other.getPayload());
082      }
083      if (other.hasNextExecutionTime()) {
084         setNextExecutionTime(other.getNextExecutionTime());
085      }
086      return this;
087   }
088
089   public int serializedSizeUnframed() {
090      if (memoizedSerializedSize != -1)
091         return memoizedSerializedSize;
092
093      int size = 0;
094      if (hasScheduler()) {
095         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getScheduler());
096      }
097      if (hasJobId()) {
098         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getJobId());
099      }
100      if (hasStartTime()) {
101         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(3, getStartTime());
102      }
103      if (hasCronEntry()) {
104         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(4, getCronEntry());
105      }
106      if (hasDelay()) {
107         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(5, getDelay());
108      }
109      if (hasPeriod()) {
110         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(6, getPeriod());
111      }
112      if (hasRepeat()) {
113         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(7, getRepeat());
114      }
115      if (hasPayload()) {
116         size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(8, getPayload());
117      }
118      if (hasNextExecutionTime()) {
119         size += org.apache.activemq.protobuf.CodedOutputStream.computeInt64Size(9, getNextExecutionTime());
120      }
121      memoizedSerializedSize = size;
122      return size;
123   }
124
125   public KahaAddScheduledJobCommand mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
126      while (true) {
127         int tag = input.readTag();
128         if ((tag & 0x07) == 4) {
129            return this;
130         }
131         switch (tag) {
132         case 0:
133            return this;
134         default: {
135            break;
136         }
137         case 10:
138            setScheduler(input.readString());
139            break;
140         case 18:
141            setJobId(input.readString());
142            break;
143         case 24:
144            setStartTime(input.readInt64());
145            break;
146         case 34:
147            setCronEntry(input.readString());
148            break;
149         case 40:
150            setDelay(input.readInt64());
151            break;
152         case 48:
153            setPeriod(input.readInt64());
154            break;
155         case 56:
156            setRepeat(input.readInt32());
157            break;
158         case 66:
159            setPayload(input.readBytes());
160            break;
161         case 72:
162            setNextExecutionTime(input.readInt64());
163            break;
164         }
165      }
166   }
167   public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
168      if (hasScheduler()) {
169         output.writeString(1, getScheduler());
170      }
171      if (hasJobId()) {
172         output.writeString(2, getJobId());
173      }
174      if (hasStartTime()) {
175         output.writeInt64(3, getStartTime());
176      }
177      if (hasCronEntry()) {
178         output.writeString(4, getCronEntry());
179      }
180      if (hasDelay()) {
181         output.writeInt64(5, getDelay());
182      }
183      if (hasPeriod()) {
184         output.writeInt64(6, getPeriod());
185      }
186      if (hasRepeat()) {
187         output.writeInt32(7, getRepeat());
188      }
189      if (hasPayload()) {
190         output.writeBytes(8, getPayload());
191      }
192      if (hasNextExecutionTime()) {
193         output.writeInt64(9, getNextExecutionTime());
194      }
195   }
196
197   public static KahaAddScheduledJobCommand parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
198      return new KahaAddScheduledJobCommand().mergeUnframed(data).checktInitialized();
199   }
200
201   public static KahaAddScheduledJobCommand parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
202      return new KahaAddScheduledJobCommand().mergeUnframed(data).checktInitialized();
203   }
204
205   public static KahaAddScheduledJobCommand parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
206      return new KahaAddScheduledJobCommand().mergeUnframed(data).checktInitialized();
207   }
208
209   public static KahaAddScheduledJobCommand parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
210      return new KahaAddScheduledJobCommand().mergeUnframed(data).checktInitialized();
211   }
212
213   public static KahaAddScheduledJobCommand parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
214      return new KahaAddScheduledJobCommand().mergeFramed(data).checktInitialized();
215   }
216
217   public static KahaAddScheduledJobCommand parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
218      return new KahaAddScheduledJobCommand().mergeFramed(data).checktInitialized();
219   }
220
221   public static KahaAddScheduledJobCommand parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
222      return new KahaAddScheduledJobCommand().mergeFramed(data).checktInitialized();
223   }
224
225   public static KahaAddScheduledJobCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
226      return new KahaAddScheduledJobCommand().mergeFramed(data).checktInitialized();
227   }
228
229   public String toString() {
230      return toString(new java.lang.StringBuilder(), "").toString();
231   }
232
233   public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
234      if(  hasScheduler() ) {
235         sb.append(prefix+"scheduler: ");
236         sb.append(getScheduler());
237         sb.append("\n");
238      }
239      if(  hasJobId() ) {
240         sb.append(prefix+"job_id: ");
241         sb.append(getJobId());
242         sb.append("\n");
243      }
244      if(  hasStartTime() ) {
245         sb.append(prefix+"start_time: ");
246         sb.append(getStartTime());
247         sb.append("\n");
248      }
249      if(  hasCronEntry() ) {
250         sb.append(prefix+"cron_entry: ");
251         sb.append(getCronEntry());
252         sb.append("\n");
253      }
254      if(  hasDelay() ) {
255         sb.append(prefix+"delay: ");
256         sb.append(getDelay());
257         sb.append("\n");
258      }
259      if(  hasPeriod() ) {
260         sb.append(prefix+"period: ");
261         sb.append(getPeriod());
262         sb.append("\n");
263      }
264      if(  hasRepeat() ) {
265         sb.append(prefix+"repeat: ");
266         sb.append(getRepeat());
267         sb.append("\n");
268      }
269      if(  hasPayload() ) {
270         sb.append(prefix+"payload: ");
271         sb.append(getPayload());
272         sb.append("\n");
273      }
274      if(  hasNextExecutionTime() ) {
275         sb.append(prefix+"next_execution_time: ");
276         sb.append(getNextExecutionTime());
277         sb.append("\n");
278      }
279      return sb;
280   }
281
282   public void visit(org.apache.activemq.store.kahadb.Visitor visitor) throws java.io.IOException {
283      visitor.visit(this);
284   }
285
286   public KahaEntryType type() {
287      return KahaEntryType.KAHA_ADD_SCHEDULED_JOB_COMMAND;
288   }
289
290   public boolean equals(Object obj) {
291      if( obj==this )
292         return true;
293      
294      if( obj==null || obj.getClass()!=KahaAddScheduledJobCommand.class )
295         return false;
296      
297      return equals((KahaAddScheduledJobCommand)obj);
298   }
299   
300   public boolean equals(KahaAddScheduledJobCommand obj) {
301      if (hasScheduler() ^ obj.hasScheduler() ) 
302         return false;
303      if (hasScheduler() && ( !getScheduler().equals(obj.getScheduler()) ))
304         return false;
305      if (hasJobId() ^ obj.hasJobId() ) 
306         return false;
307      if (hasJobId() && ( !getJobId().equals(obj.getJobId()) ))
308         return false;
309      if (hasStartTime() ^ obj.hasStartTime() ) 
310         return false;
311      if (hasStartTime() && ( getStartTime()!=obj.getStartTime() ))
312         return false;
313      if (hasCronEntry() ^ obj.hasCronEntry() ) 
314         return false;
315      if (hasCronEntry() && ( !getCronEntry().equals(obj.getCronEntry()) ))
316         return false;
317      if (hasDelay() ^ obj.hasDelay() ) 
318         return false;
319      if (hasDelay() && ( getDelay()!=obj.getDelay() ))
320         return false;
321      if (hasPeriod() ^ obj.hasPeriod() ) 
322         return false;
323      if (hasPeriod() && ( getPeriod()!=obj.getPeriod() ))
324         return false;
325      if (hasRepeat() ^ obj.hasRepeat() ) 
326         return false;
327      if (hasRepeat() && ( getRepeat()!=obj.getRepeat() ))
328         return false;
329      if (hasPayload() ^ obj.hasPayload() ) 
330         return false;
331      if (hasPayload() && ( !getPayload().equals(obj.getPayload()) ))
332         return false;
333      if (hasNextExecutionTime() ^ obj.hasNextExecutionTime() ) 
334         return false;
335      if (hasNextExecutionTime() && ( getNextExecutionTime()!=obj.getNextExecutionTime() ))
336         return false;
337      return true;
338   }
339   
340   public int hashCode() {
341      int rc=-1874430263;
342      if (hasScheduler()) {
343         rc ^= ( 1843257499^getScheduler().hashCode() );
344      }
345      if (hasJobId()) {
346         rc ^= ( 71743896^getJobId().hashCode() );
347      }
348      if (hasStartTime()) {
349         rc ^= ( -125326801^(new Long(getStartTime())).hashCode() );
350      }
351      if (hasCronEntry()) {
352         rc ^= ( -1078466972^getCronEntry().hashCode() );
353      }
354      if (hasDelay()) {
355         rc ^= ( 65915235^(new Long(getDelay())).hashCode() );
356      }
357      if (hasPeriod()) {
358         rc ^= ( -1907858975^(new Long(getPeriod())).hashCode() );
359      }
360      if (hasRepeat()) {
361         rc ^= ( -1850664517^getRepeat() );
362      }
363      if (hasPayload()) {
364         rc ^= ( 877951342^getPayload().hashCode() );
365      }
366      if (hasNextExecutionTime()) {
367         rc ^= ( 1882983858^(new Long(getNextExecutionTime())).hashCode() );
368      }
369      return rc;
370   }
371   
372}
373
374abstract class KahaAddScheduledJobCommandBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
375
376   // required string scheduler = 1;
377   private java.lang.String f_scheduler = null;
378   private boolean b_scheduler;
379
380   public boolean hasScheduler() {
381      return this.b_scheduler;
382   }
383
384   public java.lang.String getScheduler() {
385      return this.f_scheduler;
386   }
387
388   public T setScheduler(java.lang.String scheduler) {
389      loadAndClear();
390      this.b_scheduler = true;
391      this.f_scheduler = scheduler;
392      return (T)this;
393   }
394
395   public void clearScheduler() {
396      loadAndClear();
397      this.b_scheduler = false;
398      this.f_scheduler = null;
399   }
400
401   // required string job_id = 2;
402   private java.lang.String f_jobId = null;
403   private boolean b_jobId;
404
405   public boolean hasJobId() {
406      return this.b_jobId;
407   }
408
409   public java.lang.String getJobId() {
410      return this.f_jobId;
411   }
412
413   public T setJobId(java.lang.String jobId) {
414      loadAndClear();
415      this.b_jobId = true;
416      this.f_jobId = jobId;
417      return (T)this;
418   }
419
420   public void clearJobId() {
421      loadAndClear();
422      this.b_jobId = false;
423      this.f_jobId = null;
424   }
425
426   // required int64 start_time = 3;
427   private long f_startTime = 0;
428   private boolean b_startTime;
429
430   public boolean hasStartTime() {
431      return this.b_startTime;
432   }
433
434   public long getStartTime() {
435      return this.f_startTime;
436   }
437
438   public T setStartTime(long startTime) {
439      loadAndClear();
440      this.b_startTime = true;
441      this.f_startTime = startTime;
442      return (T)this;
443   }
444
445   public void clearStartTime() {
446      loadAndClear();
447      this.b_startTime = false;
448      this.f_startTime = 0;
449   }
450
451   // required string cron_entry = 4;
452   private java.lang.String f_cronEntry = null;
453   private boolean b_cronEntry;
454
455   public boolean hasCronEntry() {
456      return this.b_cronEntry;
457   }
458
459   public java.lang.String getCronEntry() {
460      return this.f_cronEntry;
461   }
462
463   public T setCronEntry(java.lang.String cronEntry) {
464      loadAndClear();
465      this.b_cronEntry = true;
466      this.f_cronEntry = cronEntry;
467      return (T)this;
468   }
469
470   public void clearCronEntry() {
471      loadAndClear();
472      this.b_cronEntry = false;
473      this.f_cronEntry = null;
474   }
475
476   // required int64 delay = 5;
477   private long f_delay = 0;
478   private boolean b_delay;
479
480   public boolean hasDelay() {
481      return this.b_delay;
482   }
483
484   public long getDelay() {
485      return this.f_delay;
486   }
487
488   public T setDelay(long delay) {
489      loadAndClear();
490      this.b_delay = true;
491      this.f_delay = delay;
492      return (T)this;
493   }
494
495   public void clearDelay() {
496      loadAndClear();
497      this.b_delay = false;
498      this.f_delay = 0;
499   }
500
501   // required int64 period = 6;
502   private long f_period = 0;
503   private boolean b_period;
504
505   public boolean hasPeriod() {
506      return this.b_period;
507   }
508
509   public long getPeriod() {
510      return this.f_period;
511   }
512
513   public T setPeriod(long period) {
514      loadAndClear();
515      this.b_period = true;
516      this.f_period = period;
517      return (T)this;
518   }
519
520   public void clearPeriod() {
521      loadAndClear();
522      this.b_period = false;
523      this.f_period = 0;
524   }
525
526   // required int32 repeat = 7;
527   private int f_repeat = 0;
528   private boolean b_repeat;
529
530   public boolean hasRepeat() {
531      return this.b_repeat;
532   }
533
534   public int getRepeat() {
535      return this.f_repeat;
536   }
537
538   public T setRepeat(int repeat) {
539      loadAndClear();
540      this.b_repeat = true;
541      this.f_repeat = repeat;
542      return (T)this;
543   }
544
545   public void clearRepeat() {
546      loadAndClear();
547      this.b_repeat = false;
548      this.f_repeat = 0;
549   }
550
551   // required bytes payload = 8;
552   private org.apache.activemq.protobuf.Buffer f_payload = null;
553   private boolean b_payload;
554
555   public boolean hasPayload() {
556      return this.b_payload;
557   }
558
559   public org.apache.activemq.protobuf.Buffer getPayload() {
560      return this.f_payload;
561   }
562
563   public T setPayload(org.apache.activemq.protobuf.Buffer payload) {
564      loadAndClear();
565      this.b_payload = true;
566      this.f_payload = payload;
567      return (T)this;
568   }
569
570   public void clearPayload() {
571      loadAndClear();
572      this.b_payload = false;
573      this.f_payload = null;
574   }
575
576   // required int64 next_execution_time = 9;
577   private long f_nextExecutionTime = 0;
578   private boolean b_nextExecutionTime;
579
580   public boolean hasNextExecutionTime() {
581      return this.b_nextExecutionTime;
582   }
583
584   public long getNextExecutionTime() {
585      return this.f_nextExecutionTime;
586   }
587
588   public T setNextExecutionTime(long nextExecutionTime) {
589      loadAndClear();
590      this.b_nextExecutionTime = true;
591      this.f_nextExecutionTime = nextExecutionTime;
592      return (T)this;
593   }
594
595   public void clearNextExecutionTime() {
596      loadAndClear();
597      this.b_nextExecutionTime = false;
598      this.f_nextExecutionTime = 0;
599   }
600
601}
602