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