45a335356f8735ac51bb1c079da13802c5712127
[vpnservice.git] / bgpmanager / bgpmanager-impl / src / main / java / org / opendaylight / bgpmanager / thrift / gen / Update.java
1 /**
2  * Autogenerated by Thrift Compiler (0.9.1)
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated
6  */
7 package org.opendaylight.bgpmanager.thrift.gen;
8
9 import org.apache.thrift.scheme.IScheme;
10 import org.apache.thrift.scheme.SchemeFactory;
11 import org.apache.thrift.scheme.StandardScheme;
12
13 import org.apache.thrift.scheme.TupleScheme;
14 import org.apache.thrift.protocol.TTupleProtocol;
15 import org.apache.thrift.protocol.TProtocolException;
16 import org.apache.thrift.EncodingUtils;
17 import org.apache.thrift.TException;
18 import org.apache.thrift.async.AsyncMethodCallback;
19 import org.apache.thrift.server.AbstractNonblockingServer.*;
20 import java.util.List;
21 import java.util.ArrayList;
22 import java.util.Map;
23 import java.util.HashMap;
24 import java.util.EnumMap;
25 import java.util.Set;
26 import java.util.HashSet;
27 import java.util.EnumSet;
28 import java.util.Collections;
29 import java.util.BitSet;
30 import java.nio.ByteBuffer;
31 import java.util.Arrays;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
34
35 public class Update implements org.apache.thrift.TBase<Update, Update._Fields>, java.io.Serializable, Cloneable, Comparable<Update> {
36   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Update");
37
38   private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
39   private static final org.apache.thrift.protocol.TField RESERVED_FIELD_DESC = new org.apache.thrift.protocol.TField("reserved", org.apache.thrift.protocol.TType.I32, (short)2);
40   private static final org.apache.thrift.protocol.TField PREFIXLEN_FIELD_DESC = new org.apache.thrift.protocol.TField("prefixlen", org.apache.thrift.protocol.TType.I32, (short)3);
41   private static final org.apache.thrift.protocol.TField LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("label", org.apache.thrift.protocol.TType.I32, (short)4);
42   private static final org.apache.thrift.protocol.TField RD_FIELD_DESC = new org.apache.thrift.protocol.TField("rd", org.apache.thrift.protocol.TType.STRING, (short)5);
43   private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)6);
44   private static final org.apache.thrift.protocol.TField NEXTHOP_FIELD_DESC = new org.apache.thrift.protocol.TField("nexthop", org.apache.thrift.protocol.TType.STRING, (short)7);
45
46   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
47   static {
48     schemes.put(StandardScheme.class, new UpdateStandardSchemeFactory());
49     schemes.put(TupleScheme.class, new UpdateTupleSchemeFactory());
50   }
51
52   public int type; // required
53   public int reserved; // required
54   public int prefixlen; // required
55   public int label; // required
56   public String rd; // required
57   public String prefix; // required
58   public String nexthop; // required
59
60   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
61   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
62     TYPE((short)1, "type"),
63     RESERVED((short)2, "reserved"),
64     PREFIXLEN((short)3, "prefixlen"),
65     LABEL((short)4, "label"),
66     RD((short)5, "rd"),
67     PREFIX((short)6, "prefix"),
68     NEXTHOP((short)7, "nexthop");
69
70     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
71
72     static {
73       for (_Fields field : EnumSet.allOf(_Fields.class)) {
74         byName.put(field.getFieldName(), field);
75       }
76     }
77
78     /**
79      * Find the _Fields constant that matches fieldId, or null if its not found.
80      */
81     public static _Fields findByThriftId(int fieldId) {
82       switch(fieldId) {
83         case 1: // TYPE
84           return TYPE;
85         case 2: // RESERVED
86           return RESERVED;
87         case 3: // PREFIXLEN
88           return PREFIXLEN;
89         case 4: // LABEL
90           return LABEL;
91         case 5: // RD
92           return RD;
93         case 6: // PREFIX
94           return PREFIX;
95         case 7: // NEXTHOP
96           return NEXTHOP;
97         default:
98           return null;
99       }
100     }
101
102     /**
103      * Find the _Fields constant that matches fieldId, throwing an exception
104      * if it is not found.
105      */
106     public static _Fields findByThriftIdOrThrow(int fieldId) {
107       _Fields fields = findByThriftId(fieldId);
108       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
109       return fields;
110     }
111
112     /**
113      * Find the _Fields constant that matches name, or null if its not found.
114      */
115     public static _Fields findByName(String name) {
116       return byName.get(name);
117     }
118
119     private final short _thriftId;
120     private final String _fieldName;
121
122     _Fields(short thriftId, String fieldName) {
123       _thriftId = thriftId;
124       _fieldName = fieldName;
125     }
126
127     public short getThriftFieldId() {
128       return _thriftId;
129     }
130
131     public String getFieldName() {
132       return _fieldName;
133     }
134   }
135
136   // isset id assignments
137   private static final int __TYPE_ISSET_ID = 0;
138   private static final int __RESERVED_ISSET_ID = 1;
139   private static final int __PREFIXLEN_ISSET_ID = 2;
140   private static final int __LABEL_ISSET_ID = 3;
141   private byte __isset_bitfield = 0;
142   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
143   static {
144     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
145     tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
147     tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
149     tmpMap.put(_Fields.PREFIXLEN, new org.apache.thrift.meta_data.FieldMetaData("prefixlen", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
151     tmpMap.put(_Fields.LABEL, new org.apache.thrift.meta_data.FieldMetaData("label", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
153     tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155     tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
157     tmpMap.put(_Fields.NEXTHOP, new org.apache.thrift.meta_data.FieldMetaData("nexthop", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
159     metaDataMap = Collections.unmodifiableMap(tmpMap);
160     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Update.class, metaDataMap);
161   }
162
163   public Update() {
164   }
165
166   public Update(
167     int type,
168     int reserved,
169     int prefixlen,
170     int label,
171     String rd,
172     String prefix,
173     String nexthop)
174   {
175     this();
176     this.type = type;
177     setTypeIsSet(true);
178     this.reserved = reserved;
179     setReservedIsSet(true);
180     this.prefixlen = prefixlen;
181     setPrefixlenIsSet(true);
182     this.label = label;
183     setLabelIsSet(true);
184     this.rd = rd;
185     this.prefix = prefix;
186     this.nexthop = nexthop;
187   }
188
189   /**
190    * Performs a deep copy on <i>other</i>.
191    */
192   public Update(Update other) {
193     __isset_bitfield = other.__isset_bitfield;
194     this.type = other.type;
195     this.reserved = other.reserved;
196     this.prefixlen = other.prefixlen;
197     this.label = other.label;
198     if (other.isSetRd()) {
199       this.rd = other.rd;
200     }
201     if (other.isSetPrefix()) {
202       this.prefix = other.prefix;
203     }
204     if (other.isSetNexthop()) {
205       this.nexthop = other.nexthop;
206     }
207   }
208
209   public Update deepCopy() {
210     return new Update(this);
211   }
212
213   @Override
214   public void clear() {
215     setTypeIsSet(false);
216     this.type = 0;
217     setReservedIsSet(false);
218     this.reserved = 0;
219     setPrefixlenIsSet(false);
220     this.prefixlen = 0;
221     setLabelIsSet(false);
222     this.label = 0;
223     this.rd = null;
224     this.prefix = null;
225     this.nexthop = null;
226   }
227
228   public int getType() {
229     return this.type;
230   }
231
232   public Update setType(int type) {
233     this.type = type;
234     setTypeIsSet(true);
235     return this;
236   }
237
238   public void unsetType() {
239     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID);
240   }
241
242   /** Returns true if field type is set (has been assigned a value) and false otherwise */
243   public boolean isSetType() {
244     return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID);
245   }
246
247   public void setTypeIsSet(boolean value) {
248     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value);
249   }
250
251   public int getReserved() {
252     return this.reserved;
253   }
254
255   public Update setReserved(int reserved) {
256     this.reserved = reserved;
257     setReservedIsSet(true);
258     return this;
259   }
260
261   public void unsetReserved() {
262     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESERVED_ISSET_ID);
263   }
264
265   /** Returns true if field reserved is set (has been assigned a value) and false otherwise */
266   public boolean isSetReserved() {
267     return EncodingUtils.testBit(__isset_bitfield, __RESERVED_ISSET_ID);
268   }
269
270   public void setReservedIsSet(boolean value) {
271     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVED_ISSET_ID, value);
272   }
273
274   public int getPrefixlen() {
275     return this.prefixlen;
276   }
277
278   public Update setPrefixlen(int prefixlen) {
279     this.prefixlen = prefixlen;
280     setPrefixlenIsSet(true);
281     return this;
282   }
283
284   public void unsetPrefixlen() {
285     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PREFIXLEN_ISSET_ID);
286   }
287
288   /** Returns true if field prefixlen is set (has been assigned a value) and false otherwise */
289   public boolean isSetPrefixlen() {
290     return EncodingUtils.testBit(__isset_bitfield, __PREFIXLEN_ISSET_ID);
291   }
292
293   public void setPrefixlenIsSet(boolean value) {
294     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PREFIXLEN_ISSET_ID, value);
295   }
296
297   public int getLabel() {
298     return this.label;
299   }
300
301   public Update setLabel(int label) {
302     this.label = label;
303     setLabelIsSet(true);
304     return this;
305   }
306
307   public void unsetLabel() {
308     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LABEL_ISSET_ID);
309   }
310
311   /** Returns true if field label is set (has been assigned a value) and false otherwise */
312   public boolean isSetLabel() {
313     return EncodingUtils.testBit(__isset_bitfield, __LABEL_ISSET_ID);
314   }
315
316   public void setLabelIsSet(boolean value) {
317     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LABEL_ISSET_ID, value);
318   }
319
320   public String getRd() {
321     return this.rd;
322   }
323
324   public Update setRd(String rd) {
325     this.rd = rd;
326     return this;
327   }
328
329   public void unsetRd() {
330     this.rd = null;
331   }
332
333   /** Returns true if field rd is set (has been assigned a value) and false otherwise */
334   public boolean isSetRd() {
335     return this.rd != null;
336   }
337
338   public void setRdIsSet(boolean value) {
339     if (!value) {
340       this.rd = null;
341     }
342   }
343
344   public String getPrefix() {
345     return this.prefix;
346   }
347
348   public Update setPrefix(String prefix) {
349     this.prefix = prefix;
350     return this;
351   }
352
353   public void unsetPrefix() {
354     this.prefix = null;
355   }
356
357   /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
358   public boolean isSetPrefix() {
359     return this.prefix != null;
360   }
361
362   public void setPrefixIsSet(boolean value) {
363     if (!value) {
364       this.prefix = null;
365     }
366   }
367
368   public String getNexthop() {
369     return this.nexthop;
370   }
371
372   public Update setNexthop(String nexthop) {
373     this.nexthop = nexthop;
374     return this;
375   }
376
377   public void unsetNexthop() {
378     this.nexthop = null;
379   }
380
381   /** Returns true if field nexthop is set (has been assigned a value) and false otherwise */
382   public boolean isSetNexthop() {
383     return this.nexthop != null;
384   }
385
386   public void setNexthopIsSet(boolean value) {
387     if (!value) {
388       this.nexthop = null;
389     }
390   }
391
392   public void setFieldValue(_Fields field, Object value) {
393     switch (field) {
394     case TYPE:
395       if (value == null) {
396         unsetType();
397       } else {
398         setType((Integer)value);
399       }
400       break;
401
402     case RESERVED:
403       if (value == null) {
404         unsetReserved();
405       } else {
406         setReserved((Integer)value);
407       }
408       break;
409
410     case PREFIXLEN:
411       if (value == null) {
412         unsetPrefixlen();
413       } else {
414         setPrefixlen((Integer)value);
415       }
416       break;
417
418     case LABEL:
419       if (value == null) {
420         unsetLabel();
421       } else {
422         setLabel((Integer)value);
423       }
424       break;
425
426     case RD:
427       if (value == null) {
428         unsetRd();
429       } else {
430         setRd((String)value);
431       }
432       break;
433
434     case PREFIX:
435       if (value == null) {
436         unsetPrefix();
437       } else {
438         setPrefix((String)value);
439       }
440       break;
441
442     case NEXTHOP:
443       if (value == null) {
444         unsetNexthop();
445       } else {
446         setNexthop((String)value);
447       }
448       break;
449
450     }
451   }
452
453   public Object getFieldValue(_Fields field) {
454     switch (field) {
455     case TYPE:
456       return Integer.valueOf(getType());
457
458     case RESERVED:
459       return Integer.valueOf(getReserved());
460
461     case PREFIXLEN:
462       return Integer.valueOf(getPrefixlen());
463
464     case LABEL:
465       return Integer.valueOf(getLabel());
466
467     case RD:
468       return getRd();
469
470     case PREFIX:
471       return getPrefix();
472
473     case NEXTHOP:
474       return getNexthop();
475
476     }
477     throw new IllegalStateException();
478   }
479
480   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
481   public boolean isSet(_Fields field) {
482     if (field == null) {
483       throw new IllegalArgumentException();
484     }
485
486     switch (field) {
487     case TYPE:
488       return isSetType();
489     case RESERVED:
490       return isSetReserved();
491     case PREFIXLEN:
492       return isSetPrefixlen();
493     case LABEL:
494       return isSetLabel();
495     case RD:
496       return isSetRd();
497     case PREFIX:
498       return isSetPrefix();
499     case NEXTHOP:
500       return isSetNexthop();
501     }
502     throw new IllegalStateException();
503   }
504
505   @Override
506   public boolean equals(Object that) {
507     if (that == null)
508       return false;
509     if (that instanceof Update)
510       return this.equals((Update)that);
511     return false;
512   }
513
514   public boolean equals(Update that) {
515     if (that == null)
516       return false;
517
518     boolean this_present_type = true;
519     boolean that_present_type = true;
520     if (this_present_type || that_present_type) {
521       if (!(this_present_type && that_present_type))
522         return false;
523       if (this.type != that.type)
524         return false;
525     }
526
527     boolean this_present_reserved = true;
528     boolean that_present_reserved = true;
529     if (this_present_reserved || that_present_reserved) {
530       if (!(this_present_reserved && that_present_reserved))
531         return false;
532       if (this.reserved != that.reserved)
533         return false;
534     }
535
536     boolean this_present_prefixlen = true;
537     boolean that_present_prefixlen = true;
538     if (this_present_prefixlen || that_present_prefixlen) {
539       if (!(this_present_prefixlen && that_present_prefixlen))
540         return false;
541       if (this.prefixlen != that.prefixlen)
542         return false;
543     }
544
545     boolean this_present_label = true;
546     boolean that_present_label = true;
547     if (this_present_label || that_present_label) {
548       if (!(this_present_label && that_present_label))
549         return false;
550       if (this.label != that.label)
551         return false;
552     }
553
554     boolean this_present_rd = true && this.isSetRd();
555     boolean that_present_rd = true && that.isSetRd();
556     if (this_present_rd || that_present_rd) {
557       if (!(this_present_rd && that_present_rd))
558         return false;
559       if (!this.rd.equals(that.rd))
560         return false;
561     }
562
563     boolean this_present_prefix = true && this.isSetPrefix();
564     boolean that_present_prefix = true && that.isSetPrefix();
565     if (this_present_prefix || that_present_prefix) {
566       if (!(this_present_prefix && that_present_prefix))
567         return false;
568       if (!this.prefix.equals(that.prefix))
569         return false;
570     }
571
572     boolean this_present_nexthop = true && this.isSetNexthop();
573     boolean that_present_nexthop = true && that.isSetNexthop();
574     if (this_present_nexthop || that_present_nexthop) {
575       if (!(this_present_nexthop && that_present_nexthop))
576         return false;
577       if (!this.nexthop.equals(that.nexthop))
578         return false;
579     }
580
581     return true;
582   }
583
584   @Override
585   public int hashCode() {
586     return 0;
587   }
588
589   @Override
590   public int compareTo(Update other) {
591     if (!getClass().equals(other.getClass())) {
592       return getClass().getName().compareTo(other.getClass().getName());
593     }
594
595     int lastComparison = 0;
596
597     lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
598     if (lastComparison != 0) {
599       return lastComparison;
600     }
601     if (isSetType()) {
602       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
603       if (lastComparison != 0) {
604         return lastComparison;
605       }
606     }
607     lastComparison = Boolean.valueOf(isSetReserved()).compareTo(other.isSetReserved());
608     if (lastComparison != 0) {
609       return lastComparison;
610     }
611     if (isSetReserved()) {
612       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, other.reserved);
613       if (lastComparison != 0) {
614         return lastComparison;
615       }
616     }
617     lastComparison = Boolean.valueOf(isSetPrefixlen()).compareTo(other.isSetPrefixlen());
618     if (lastComparison != 0) {
619       return lastComparison;
620     }
621     if (isSetPrefixlen()) {
622       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefixlen, other.prefixlen);
623       if (lastComparison != 0) {
624         return lastComparison;
625       }
626     }
627     lastComparison = Boolean.valueOf(isSetLabel()).compareTo(other.isSetLabel());
628     if (lastComparison != 0) {
629       return lastComparison;
630     }
631     if (isSetLabel()) {
632       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.label, other.label);
633       if (lastComparison != 0) {
634         return lastComparison;
635       }
636     }
637     lastComparison = Boolean.valueOf(isSetRd()).compareTo(other.isSetRd());
638     if (lastComparison != 0) {
639       return lastComparison;
640     }
641     if (isSetRd()) {
642       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rd, other.rd);
643       if (lastComparison != 0) {
644         return lastComparison;
645       }
646     }
647     lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(other.isSetPrefix());
648     if (lastComparison != 0) {
649       return lastComparison;
650     }
651     if (isSetPrefix()) {
652       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, other.prefix);
653       if (lastComparison != 0) {
654         return lastComparison;
655       }
656     }
657     lastComparison = Boolean.valueOf(isSetNexthop()).compareTo(other.isSetNexthop());
658     if (lastComparison != 0) {
659       return lastComparison;
660     }
661     if (isSetNexthop()) {
662       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nexthop, other.nexthop);
663       if (lastComparison != 0) {
664         return lastComparison;
665       }
666     }
667     return 0;
668   }
669
670   public _Fields fieldForId(int fieldId) {
671     return _Fields.findByThriftId(fieldId);
672   }
673
674   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
675     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
676   }
677
678   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
679     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
680   }
681
682   @Override
683   public String toString() {
684     StringBuilder sb = new StringBuilder("Update(");
685     boolean first = true;
686
687     sb.append("type:");
688     sb.append(this.type);
689     first = false;
690     if (!first) sb.append(", ");
691     sb.append("reserved:");
692     sb.append(this.reserved);
693     first = false;
694     if (!first) sb.append(", ");
695     sb.append("prefixlen:");
696     sb.append(this.prefixlen);
697     first = false;
698     if (!first) sb.append(", ");
699     sb.append("label:");
700     sb.append(this.label);
701     first = false;
702     if (!first) sb.append(", ");
703     sb.append("rd:");
704     if (this.rd == null) {
705       sb.append("null");
706     } else {
707       sb.append(this.rd);
708     }
709     first = false;
710     if (!first) sb.append(", ");
711     sb.append("prefix:");
712     if (this.prefix == null) {
713       sb.append("null");
714     } else {
715       sb.append(this.prefix);
716     }
717     first = false;
718     if (!first) sb.append(", ");
719     sb.append("nexthop:");
720     if (this.nexthop == null) {
721       sb.append("null");
722     } else {
723       sb.append(this.nexthop);
724     }
725     first = false;
726     sb.append(")");
727     return sb.toString();
728   }
729
730   public void validate() throws org.apache.thrift.TException {
731     // check for required fields
732     // check for sub-struct validity
733   }
734
735   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
736     try {
737       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
738     } catch (org.apache.thrift.TException te) {
739       throw new java.io.IOException(te);
740     }
741   }
742
743   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
744     try {
745       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
746       __isset_bitfield = 0;
747       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
748     } catch (org.apache.thrift.TException te) {
749       throw new java.io.IOException(te);
750     }
751   }
752
753   private static class UpdateStandardSchemeFactory implements SchemeFactory {
754     public UpdateStandardScheme getScheme() {
755       return new UpdateStandardScheme();
756     }
757   }
758
759   private static class UpdateStandardScheme extends StandardScheme<Update> {
760
761     public void read(org.apache.thrift.protocol.TProtocol iprot, Update struct) throws org.apache.thrift.TException {
762       org.apache.thrift.protocol.TField schemeField;
763       iprot.readStructBegin();
764       while (true)
765       {
766         schemeField = iprot.readFieldBegin();
767         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
768           break;
769         }
770         switch (schemeField.id) {
771           case 1: // TYPE
772             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
773               struct.type = iprot.readI32();
774               struct.setTypeIsSet(true);
775             } else { 
776               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
777             }
778             break;
779           case 2: // RESERVED
780             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
781               struct.reserved = iprot.readI32();
782               struct.setReservedIsSet(true);
783             } else { 
784               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
785             }
786             break;
787           case 3: // PREFIXLEN
788             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
789               struct.prefixlen = iprot.readI32();
790               struct.setPrefixlenIsSet(true);
791             } else { 
792               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
793             }
794             break;
795           case 4: // LABEL
796             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
797               struct.label = iprot.readI32();
798               struct.setLabelIsSet(true);
799             } else { 
800               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
801             }
802             break;
803           case 5: // RD
804             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
805               struct.rd = iprot.readString();
806               struct.setRdIsSet(true);
807             } else { 
808               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
809             }
810             break;
811           case 6: // PREFIX
812             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
813               struct.prefix = iprot.readString();
814               struct.setPrefixIsSet(true);
815             } else { 
816               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
817             }
818             break;
819           case 7: // NEXTHOP
820             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
821               struct.nexthop = iprot.readString();
822               struct.setNexthopIsSet(true);
823             } else { 
824               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
825             }
826             break;
827           default:
828             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
829         }
830         iprot.readFieldEnd();
831       }
832       iprot.readStructEnd();
833
834       // check for required fields of primitive type, which can't be checked in the validate method
835       struct.validate();
836     }
837
838     public void write(org.apache.thrift.protocol.TProtocol oprot, Update struct) throws org.apache.thrift.TException {
839       struct.validate();
840
841       oprot.writeStructBegin(STRUCT_DESC);
842       oprot.writeFieldBegin(TYPE_FIELD_DESC);
843       oprot.writeI32(struct.type);
844       oprot.writeFieldEnd();
845       oprot.writeFieldBegin(RESERVED_FIELD_DESC);
846       oprot.writeI32(struct.reserved);
847       oprot.writeFieldEnd();
848       oprot.writeFieldBegin(PREFIXLEN_FIELD_DESC);
849       oprot.writeI32(struct.prefixlen);
850       oprot.writeFieldEnd();
851       oprot.writeFieldBegin(LABEL_FIELD_DESC);
852       oprot.writeI32(struct.label);
853       oprot.writeFieldEnd();
854       if (struct.rd != null) {
855         oprot.writeFieldBegin(RD_FIELD_DESC);
856         oprot.writeString(struct.rd);
857         oprot.writeFieldEnd();
858       }
859       if (struct.prefix != null) {
860         oprot.writeFieldBegin(PREFIX_FIELD_DESC);
861         oprot.writeString(struct.prefix);
862         oprot.writeFieldEnd();
863       }
864       if (struct.nexthop != null) {
865         oprot.writeFieldBegin(NEXTHOP_FIELD_DESC);
866         oprot.writeString(struct.nexthop);
867         oprot.writeFieldEnd();
868       }
869       oprot.writeFieldStop();
870       oprot.writeStructEnd();
871     }
872
873   }
874
875   private static class UpdateTupleSchemeFactory implements SchemeFactory {
876     public UpdateTupleScheme getScheme() {
877       return new UpdateTupleScheme();
878     }
879   }
880
881   private static class UpdateTupleScheme extends TupleScheme<Update> {
882
883     @Override
884     public void write(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException {
885       TTupleProtocol oprot = (TTupleProtocol) prot;
886       BitSet optionals = new BitSet();
887       if (struct.isSetType()) {
888         optionals.set(0);
889       }
890       if (struct.isSetReserved()) {
891         optionals.set(1);
892       }
893       if (struct.isSetPrefixlen()) {
894         optionals.set(2);
895       }
896       if (struct.isSetLabel()) {
897         optionals.set(3);
898       }
899       if (struct.isSetRd()) {
900         optionals.set(4);
901       }
902       if (struct.isSetPrefix()) {
903         optionals.set(5);
904       }
905       if (struct.isSetNexthop()) {
906         optionals.set(6);
907       }
908       oprot.writeBitSet(optionals, 7);
909       if (struct.isSetType()) {
910         oprot.writeI32(struct.type);
911       }
912       if (struct.isSetReserved()) {
913         oprot.writeI32(struct.reserved);
914       }
915       if (struct.isSetPrefixlen()) {
916         oprot.writeI32(struct.prefixlen);
917       }
918       if (struct.isSetLabel()) {
919         oprot.writeI32(struct.label);
920       }
921       if (struct.isSetRd()) {
922         oprot.writeString(struct.rd);
923       }
924       if (struct.isSetPrefix()) {
925         oprot.writeString(struct.prefix);
926       }
927       if (struct.isSetNexthop()) {
928         oprot.writeString(struct.nexthop);
929       }
930     }
931
932     @Override
933     public void read(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException {
934       TTupleProtocol iprot = (TTupleProtocol) prot;
935       BitSet incoming = iprot.readBitSet(7);
936       if (incoming.get(0)) {
937         struct.type = iprot.readI32();
938         struct.setTypeIsSet(true);
939       }
940       if (incoming.get(1)) {
941         struct.reserved = iprot.readI32();
942         struct.setReservedIsSet(true);
943       }
944       if (incoming.get(2)) {
945         struct.prefixlen = iprot.readI32();
946         struct.setPrefixlenIsSet(true);
947       }
948       if (incoming.get(3)) {
949         struct.label = iprot.readI32();
950         struct.setLabelIsSet(true);
951       }
952       if (incoming.get(4)) {
953         struct.rd = iprot.readString();
954         struct.setRdIsSet(true);
955       }
956       if (incoming.get(5)) {
957         struct.prefix = iprot.readString();
958         struct.setPrefixIsSet(true);
959       }
960       if (incoming.get(6)) {
961         struct.nexthop = iprot.readString();
962         struct.setNexthopIsSet(true);
963       }
964     }
965   }
966
967 }
968