001//
002// Generated by protoc, do not edit by hand.
003//
004package org.apache.activemq.store.kahadb.data;
005
006
007public final class KahaDestroySchedulerCommand extends KahaDestroySchedulerCommandBase<KahaDestroySchedulerCommand> implements org.apache.activemq.store.kahadb.JournalCommand<KahaDestroySchedulerCommand> {
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      return missingFields;
015   }
016
017   public void clear() {
018      super.clear();
019      clearScheduler();
020   }
021
022   public KahaDestroySchedulerCommand clone() {
023      return new KahaDestroySchedulerCommand().mergeFrom(this);
024   }
025
026   public KahaDestroySchedulerCommand mergeFrom(KahaDestroySchedulerCommand other) {
027      if (other.hasScheduler()) {
028         setScheduler(other.getScheduler());
029      }
030      return this;
031   }
032
033   public int serializedSizeUnframed() {
034      if (memoizedSerializedSize != -1)
035         return memoizedSerializedSize;
036
037      int size = 0;
038      if (hasScheduler()) {
039         size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(1, getScheduler());
040      }
041      memoizedSerializedSize = size;
042      return size;
043   }
044
045   public KahaDestroySchedulerCommand mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
046      while (true) {
047         int tag = input.readTag();
048         if ((tag & 0x07) == 4) {
049            return this;
050         }
051         switch (tag) {
052         case 0:
053            return this;
054         default: {
055            break;
056         }
057         case 10:
058            setScheduler(input.readString());
059            break;
060         }
061      }
062   }
063   public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
064      if (hasScheduler()) {
065         output.writeString(1, getScheduler());
066      }
067   }
068
069   public static KahaDestroySchedulerCommand parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
070      return new KahaDestroySchedulerCommand().mergeUnframed(data).checktInitialized();
071   }
072
073   public static KahaDestroySchedulerCommand parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
074      return new KahaDestroySchedulerCommand().mergeUnframed(data).checktInitialized();
075   }
076
077   public static KahaDestroySchedulerCommand parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
078      return new KahaDestroySchedulerCommand().mergeUnframed(data).checktInitialized();
079   }
080
081   public static KahaDestroySchedulerCommand parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
082      return new KahaDestroySchedulerCommand().mergeUnframed(data).checktInitialized();
083   }
084
085   public static KahaDestroySchedulerCommand parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
086      return new KahaDestroySchedulerCommand().mergeFramed(data).checktInitialized();
087   }
088
089   public static KahaDestroySchedulerCommand parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
090      return new KahaDestroySchedulerCommand().mergeFramed(data).checktInitialized();
091   }
092
093   public static KahaDestroySchedulerCommand parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
094      return new KahaDestroySchedulerCommand().mergeFramed(data).checktInitialized();
095   }
096
097   public static KahaDestroySchedulerCommand parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
098      return new KahaDestroySchedulerCommand().mergeFramed(data).checktInitialized();
099   }
100
101   public String toString() {
102      return toString(new java.lang.StringBuilder(), "").toString();
103   }
104
105   public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
106      if(  hasScheduler() ) {
107         sb.append(prefix+"scheduler: ");
108         sb.append(getScheduler());
109         sb.append("\n");
110      }
111      return sb;
112   }
113
114   public void visit(org.apache.activemq.store.kahadb.Visitor visitor) throws java.io.IOException {
115      visitor.visit(this);
116   }
117
118   public KahaEntryType type() {
119      return KahaEntryType.KAHA_DESTROY_SCHEDULER_COMMAND;
120   }
121
122   public boolean equals(Object obj) {
123      if( obj==this )
124         return true;
125      
126      if( obj==null || obj.getClass()!=KahaDestroySchedulerCommand.class )
127         return false;
128      
129      return equals((KahaDestroySchedulerCommand)obj);
130   }
131   
132   public boolean equals(KahaDestroySchedulerCommand obj) {
133      if (hasScheduler() ^ obj.hasScheduler() ) 
134         return false;
135      if (hasScheduler() && ( !getScheduler().equals(obj.getScheduler()) ))
136         return false;
137      return true;
138   }
139   
140   public int hashCode() {
141      int rc=1034868795;
142      if (hasScheduler()) {
143         rc ^= ( 1843257499^getScheduler().hashCode() );
144      }
145      return rc;
146   }
147   
148}
149
150abstract class KahaDestroySchedulerCommandBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
151
152   // required string scheduler = 1;
153   private java.lang.String f_scheduler = null;
154   private boolean b_scheduler;
155
156   public boolean hasScheduler() {
157      return this.b_scheduler;
158   }
159
160   public java.lang.String getScheduler() {
161      return this.f_scheduler;
162   }
163
164   public T setScheduler(java.lang.String scheduler) {
165      loadAndClear();
166      this.b_scheduler = true;
167      this.f_scheduler = scheduler;
168      return (T)this;
169   }
170
171   public void clearScheduler() {
172      loadAndClear();
173      this.b_scheduler = false;
174      this.f_scheduler = null;
175   }
176
177}
178