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