Fix build faliures due to OFPlugin checktyle fixes
[netvirt.git] / bgpmanager / bgpmanager-impl / src / main / java / org / opendaylight / netvirt / bgpmanager / thrift / gen / Update.java
1 /**
2  * Autogenerated by Thrift Compiler (0.9.3)
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated
6  */
7  package org.opendaylight.netvirt.bgpmanager.thrift.gen;
8 import org.apache.thrift.scheme.IScheme;
9 import org.apache.thrift.scheme.SchemeFactory;
10 import org.apache.thrift.scheme.StandardScheme;
11
12 import org.apache.thrift.scheme.TupleScheme;
13 import org.apache.thrift.protocol.TTupleProtocol;
14 import org.apache.thrift.protocol.TProtocolException;
15 import org.apache.thrift.EncodingUtils;
16 import org.apache.thrift.TException;
17 import org.apache.thrift.async.AsyncMethodCallback;
18 import org.apache.thrift.server.AbstractNonblockingServer.*;
19 import java.util.List;
20 import java.util.ArrayList;
21 import java.util.Map;
22 import java.util.HashMap;
23 import java.util.EnumMap;
24 import java.util.Set;
25 import java.util.HashSet;
26 import java.util.EnumSet;
27 import java.util.Collections;
28 import java.util.BitSet;
29 import java.nio.ByteBuffer;
30 import java.util.Arrays;
31 import javax.annotation.Generated;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
34
35 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
36 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-09-13")
37 public class Update implements org.apache.thrift.TBase<Update, Update._Fields>, java.io.Serializable, Cloneable, Comparable<Update> {
38   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Update");
39
40   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);
41   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);
42   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);
43   private static final org.apache.thrift.protocol.TField L3LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l3label", org.apache.thrift.protocol.TType.I32, (short)4);
44   private static final org.apache.thrift.protocol.TField L2LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("l2label", org.apache.thrift.protocol.TType.I32, (short)5);
45   private static final org.apache.thrift.protocol.TField ETHTAG_FIELD_DESC = new org.apache.thrift.protocol.TField("ethtag", org.apache.thrift.protocol.TType.I32, (short)6);
46   private static final org.apache.thrift.protocol.TField ESI_FIELD_DESC = new org.apache.thrift.protocol.TField("esi", org.apache.thrift.protocol.TType.STRING, (short)7);
47   private static final org.apache.thrift.protocol.TField MACADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("macaddress", org.apache.thrift.protocol.TType.STRING, (short)8);
48   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)9);
49   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)10);
50   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)11);
51   private static final org.apache.thrift.protocol.TField ROUTERMAC_FIELD_DESC = new org.apache.thrift.protocol.TField("routermac", org.apache.thrift.protocol.TType.STRING, (short)12);
52
53   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
54   static {
55     schemes.put(StandardScheme.class, new UpdateStandardSchemeFactory());
56     schemes.put(TupleScheme.class, new UpdateTupleSchemeFactory());
57   }
58
59   public int type; // required
60   public int reserved; // required
61   public int prefixlen; // required
62   public int l3label; // required
63   public int l2label; // required
64   public int ethtag; // required
65   public String esi; // required
66   public String macaddress; // required
67   public String rd; // required
68   public String prefix; // required
69   public String nexthop; // required
70   public String routermac; // required
71
72   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
73   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
74     TYPE((short)1, "type"),
75     RESERVED((short)2, "reserved"),
76     PREFIXLEN((short)3, "prefixlen"),
77     L3LABEL((short)4, "l3label"),
78     L2LABEL((short)5, "l2label"),
79     ETHTAG((short)6, "ethtag"),
80     ESI((short)7, "esi"),
81     MACADDRESS((short)8, "macaddress"),
82     RD((short)9, "rd"),
83     PREFIX((short)10, "prefix"),
84     NEXTHOP((short)11, "nexthop"),
85     ROUTERMAC((short)12, "routermac");
86
87     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
88
89     static {
90       for (_Fields field : EnumSet.allOf(_Fields.class)) {
91         byName.put(field.getFieldName(), field);
92       }
93     }
94
95     /**
96      * Find the _Fields constant that matches fieldId, or null if its not found.
97      */
98     public static _Fields findByThriftId(int fieldId) {
99       switch(fieldId) {
100         case 1: // TYPE
101           return TYPE;
102         case 2: // RESERVED
103           return RESERVED;
104         case 3: // PREFIXLEN
105           return PREFIXLEN;
106         case 4: // L3LABEL
107           return L3LABEL;
108         case 5: // L2LABEL
109           return L2LABEL;
110         case 6: // ETHTAG
111           return ETHTAG;
112         case 7: // ESI
113           return ESI;
114         case 8: // MACADDRESS
115           return MACADDRESS;
116         case 9: // RD
117           return RD;
118         case 10: // PREFIX
119           return PREFIX;
120         case 11: // NEXTHOP
121           return NEXTHOP;
122         case 12: // ROUTERMAC
123           return ROUTERMAC;
124         default:
125           return null;
126       }
127     }
128
129     /**
130      * Find the _Fields constant that matches fieldId, throwing an exception
131      * if it is not found.
132      */
133     public static _Fields findByThriftIdOrThrow(int fieldId) {
134       _Fields fields = findByThriftId(fieldId);
135       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
136       return fields;
137     }
138
139     /**
140      * Find the _Fields constant that matches name, or null if its not found.
141      */
142     public static _Fields findByName(String name) {
143       return byName.get(name);
144     }
145
146     private final short _thriftId;
147     private final String _fieldName;
148
149     _Fields(short thriftId, String fieldName) {
150       _thriftId = thriftId;
151       _fieldName = fieldName;
152     }
153
154     public short getThriftFieldId() {
155       return _thriftId;
156     }
157
158     public String getFieldName() {
159       return _fieldName;
160     }
161   }
162
163   // isset id assignments
164   private static final int __TYPE_ISSET_ID = 0;
165   private static final int __RESERVED_ISSET_ID = 1;
166   private static final int __PREFIXLEN_ISSET_ID = 2;
167   private static final int __L3LABEL_ISSET_ID = 3;
168   private static final int __L2LABEL_ISSET_ID = 4;
169   private static final int __ETHTAG_ISSET_ID = 5;
170   private byte __isset_bitfield = 0;
171   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
172   static {
173     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
174     tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
175         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
176     tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
177         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
178     tmpMap.put(_Fields.PREFIXLEN, new org.apache.thrift.meta_data.FieldMetaData("prefixlen", org.apache.thrift.TFieldRequirementType.DEFAULT, 
179         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
180     tmpMap.put(_Fields.L3LABEL, new org.apache.thrift.meta_data.FieldMetaData("l3label", org.apache.thrift.TFieldRequirementType.DEFAULT, 
181         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
182     tmpMap.put(_Fields.L2LABEL, new org.apache.thrift.meta_data.FieldMetaData("l2label", org.apache.thrift.TFieldRequirementType.DEFAULT, 
183         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
184     tmpMap.put(_Fields.ETHTAG, new org.apache.thrift.meta_data.FieldMetaData("ethtag", org.apache.thrift.TFieldRequirementType.DEFAULT, 
185         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
186     tmpMap.put(_Fields.ESI, new org.apache.thrift.meta_data.FieldMetaData("esi", org.apache.thrift.TFieldRequirementType.DEFAULT, 
187         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
188     tmpMap.put(_Fields.MACADDRESS, new org.apache.thrift.meta_data.FieldMetaData("macaddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
189         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
190     tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
191         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
192     tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
193         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
194     tmpMap.put(_Fields.NEXTHOP, new org.apache.thrift.meta_data.FieldMetaData("nexthop", org.apache.thrift.TFieldRequirementType.DEFAULT, 
195         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
196     tmpMap.put(_Fields.ROUTERMAC, new org.apache.thrift.meta_data.FieldMetaData("routermac", org.apache.thrift.TFieldRequirementType.DEFAULT, 
197         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
198     metaDataMap = Collections.unmodifiableMap(tmpMap);
199     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Update.class, metaDataMap);
200   }
201
202   public Update() {
203   }
204
205   public Update(
206     int type,
207     int reserved,
208     int prefixlen,
209     int l3label,
210     int l2label,
211     int ethtag,
212     String esi,
213     String macaddress,
214     String rd,
215     String prefix,
216     String nexthop,
217     String routermac)
218   {
219     this();
220     this.type = type;
221     setTypeIsSet(true);
222     this.reserved = reserved;
223     setReservedIsSet(true);
224     this.prefixlen = prefixlen;
225     setPrefixlenIsSet(true);
226     this.l3label = l3label;
227     setL3labelIsSet(true);
228     this.l2label = l2label;
229     setL2labelIsSet(true);
230     this.ethtag = ethtag;
231     setEthtagIsSet(true);
232     this.esi = esi;
233     this.macaddress = macaddress;
234     this.rd = rd;
235     this.prefix = prefix;
236     this.nexthop = nexthop;
237     this.routermac = routermac;
238   }
239
240   /**
241    * Performs a deep copy on <i>other</i>.
242    */
243   public Update(Update other) {
244     __isset_bitfield = other.__isset_bitfield;
245     this.type = other.type;
246     this.reserved = other.reserved;
247     this.prefixlen = other.prefixlen;
248     this.l3label = other.l3label;
249     this.l2label = other.l2label;
250     this.ethtag = other.ethtag;
251     if (other.isSetEsi()) {
252       this.esi = other.esi;
253     }
254     if (other.isSetMacaddress()) {
255       this.macaddress = other.macaddress;
256     }
257     if (other.isSetRd()) {
258       this.rd = other.rd;
259     }
260     if (other.isSetPrefix()) {
261       this.prefix = other.prefix;
262     }
263     if (other.isSetNexthop()) {
264       this.nexthop = other.nexthop;
265     }
266     if (other.isSetRoutermac()) {
267       this.routermac = other.routermac;
268     }
269   }
270
271   public Update deepCopy() {
272     return new Update(this);
273   }
274
275   @Override
276   public void clear() {
277     setTypeIsSet(false);
278     this.type = 0;
279     setReservedIsSet(false);
280     this.reserved = 0;
281     setPrefixlenIsSet(false);
282     this.prefixlen = 0;
283     setL3labelIsSet(false);
284     this.l3label = 0;
285     setL2labelIsSet(false);
286     this.l2label = 0;
287     setEthtagIsSet(false);
288     this.ethtag = 0;
289     this.esi = null;
290     this.macaddress = null;
291     this.rd = null;
292     this.prefix = null;
293     this.nexthop = null;
294     this.routermac = null;
295   }
296
297   public int getType() {
298     return this.type;
299   }
300
301   public Update setType(int type) {
302     this.type = type;
303     setTypeIsSet(true);
304     return this;
305   }
306
307   public void unsetType() {
308     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID);
309   }
310
311   /** Returns true if field type is set (has been assigned a value) and false otherwise */
312   public boolean isSetType() {
313     return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID);
314   }
315
316   public void setTypeIsSet(boolean value) {
317     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value);
318   }
319
320   public int getReserved() {
321     return this.reserved;
322   }
323
324   public Update setReserved(int reserved) {
325     this.reserved = reserved;
326     setReservedIsSet(true);
327     return this;
328   }
329
330   public void unsetReserved() {
331     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESERVED_ISSET_ID);
332   }
333
334   /** Returns true if field reserved is set (has been assigned a value) and false otherwise */
335   public boolean isSetReserved() {
336     return EncodingUtils.testBit(__isset_bitfield, __RESERVED_ISSET_ID);
337   }
338
339   public void setReservedIsSet(boolean value) {
340     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVED_ISSET_ID, value);
341   }
342
343   public int getPrefixlen() {
344     return this.prefixlen;
345   }
346
347   public Update setPrefixlen(int prefixlen) {
348     this.prefixlen = prefixlen;
349     setPrefixlenIsSet(true);
350     return this;
351   }
352
353   public void unsetPrefixlen() {
354     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PREFIXLEN_ISSET_ID);
355   }
356
357   /** Returns true if field prefixlen is set (has been assigned a value) and false otherwise */
358   public boolean isSetPrefixlen() {
359     return EncodingUtils.testBit(__isset_bitfield, __PREFIXLEN_ISSET_ID);
360   }
361
362   public void setPrefixlenIsSet(boolean value) {
363     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PREFIXLEN_ISSET_ID, value);
364   }
365
366   public int getL3label() {
367     return this.l3label;
368   }
369
370   public Update setL3label(int l3label) {
371     this.l3label = l3label;
372     setL3labelIsSet(true);
373     return this;
374   }
375
376   public void unsetL3label() {
377     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __L3LABEL_ISSET_ID);
378   }
379
380   /** Returns true if field l3label is set (has been assigned a value) and false otherwise */
381   public boolean isSetL3label() {
382     return EncodingUtils.testBit(__isset_bitfield, __L3LABEL_ISSET_ID);
383   }
384
385   public void setL3labelIsSet(boolean value) {
386     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __L3LABEL_ISSET_ID, value);
387   }
388
389   public int getL2label() {
390     return this.l2label;
391   }
392
393   public Update setL2label(int l2label) {
394     this.l2label = l2label;
395     setL2labelIsSet(true);
396     return this;
397   }
398
399   public void unsetL2label() {
400     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __L2LABEL_ISSET_ID);
401   }
402
403   /** Returns true if field l2label is set (has been assigned a value) and false otherwise */
404   public boolean isSetL2label() {
405     return EncodingUtils.testBit(__isset_bitfield, __L2LABEL_ISSET_ID);
406   }
407
408   public void setL2labelIsSet(boolean value) {
409     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __L2LABEL_ISSET_ID, value);
410   }
411
412   public int getEthtag() {
413     return this.ethtag;
414   }
415
416   public Update setEthtag(int ethtag) {
417     this.ethtag = ethtag;
418     setEthtagIsSet(true);
419     return this;
420   }
421
422   public void unsetEthtag() {
423     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ETHTAG_ISSET_ID);
424   }
425
426   /** Returns true if field ethtag is set (has been assigned a value) and false otherwise */
427   public boolean isSetEthtag() {
428     return EncodingUtils.testBit(__isset_bitfield, __ETHTAG_ISSET_ID);
429   }
430
431   public void setEthtagIsSet(boolean value) {
432     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ETHTAG_ISSET_ID, value);
433   }
434
435   public String getEsi() {
436     return this.esi;
437   }
438
439   public Update setEsi(String esi) {
440     this.esi = esi;
441     return this;
442   }
443
444   public void unsetEsi() {
445     this.esi = null;
446   }
447
448   /** Returns true if field esi is set (has been assigned a value) and false otherwise */
449   public boolean isSetEsi() {
450     return this.esi != null;
451   }
452
453   public void setEsiIsSet(boolean value) {
454     if (!value) {
455       this.esi = null;
456     }
457   }
458
459   public String getMacaddress() {
460     return this.macaddress;
461   }
462
463   public Update setMacaddress(String macaddress) {
464     this.macaddress = macaddress;
465     return this;
466   }
467
468   public void unsetMacaddress() {
469     this.macaddress = null;
470   }
471
472   /** Returns true if field macaddress is set (has been assigned a value) and false otherwise */
473   public boolean isSetMacaddress() {
474     return this.macaddress != null;
475   }
476
477   public void setMacaddressIsSet(boolean value) {
478     if (!value) {
479       this.macaddress = null;
480     }
481   }
482
483   public String getRd() {
484     return this.rd;
485   }
486
487   public Update setRd(String rd) {
488     this.rd = rd;
489     return this;
490   }
491
492   public void unsetRd() {
493     this.rd = null;
494   }
495
496   /** Returns true if field rd is set (has been assigned a value) and false otherwise */
497   public boolean isSetRd() {
498     return this.rd != null;
499   }
500
501   public void setRdIsSet(boolean value) {
502     if (!value) {
503       this.rd = null;
504     }
505   }
506
507   public String getPrefix() {
508     return this.prefix;
509   }
510
511   public Update setPrefix(String prefix) {
512     this.prefix = prefix;
513     return this;
514   }
515
516   public void unsetPrefix() {
517     this.prefix = null;
518   }
519
520   /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
521   public boolean isSetPrefix() {
522     return this.prefix != null;
523   }
524
525   public void setPrefixIsSet(boolean value) {
526     if (!value) {
527       this.prefix = null;
528     }
529   }
530
531   public String getNexthop() {
532     return this.nexthop;
533   }
534
535   public Update setNexthop(String nexthop) {
536     this.nexthop = nexthop;
537     return this;
538   }
539
540   public void unsetNexthop() {
541     this.nexthop = null;
542   }
543
544   /** Returns true if field nexthop is set (has been assigned a value) and false otherwise */
545   public boolean isSetNexthop() {
546     return this.nexthop != null;
547   }
548
549   public void setNexthopIsSet(boolean value) {
550     if (!value) {
551       this.nexthop = null;
552     }
553   }
554
555   public String getRoutermac() {
556     return this.routermac;
557   }
558
559   public Update setRoutermac(String routermac) {
560     this.routermac = routermac;
561     return this;
562   }
563
564   public void unsetRoutermac() {
565     this.routermac = null;
566   }
567
568   /** Returns true if field routermac is set (has been assigned a value) and false otherwise */
569   public boolean isSetRoutermac() {
570     return this.routermac != null;
571   }
572
573   public void setRoutermacIsSet(boolean value) {
574     if (!value) {
575       this.routermac = null;
576     }
577   }
578
579   public void setFieldValue(_Fields field, Object value) {
580     switch (field) {
581     case TYPE:
582       if (value == null) {
583         unsetType();
584       } else {
585         setType((Integer)value);
586       }
587       break;
588
589     case RESERVED:
590       if (value == null) {
591         unsetReserved();
592       } else {
593         setReserved((Integer)value);
594       }
595       break;
596
597     case PREFIXLEN:
598       if (value == null) {
599         unsetPrefixlen();
600       } else {
601         setPrefixlen((Integer)value);
602       }
603       break;
604
605     case L3LABEL:
606       if (value == null) {
607         unsetL3label();
608       } else {
609         setL3label((Integer)value);
610       }
611       break;
612
613     case L2LABEL:
614       if (value == null) {
615         unsetL2label();
616       } else {
617         setL2label((Integer)value);
618       }
619       break;
620
621     case ETHTAG:
622       if (value == null) {
623         unsetEthtag();
624       } else {
625         setEthtag((Integer)value);
626       }
627       break;
628
629     case ESI:
630       if (value == null) {
631         unsetEsi();
632       } else {
633         setEsi((String)value);
634       }
635       break;
636
637     case MACADDRESS:
638       if (value == null) {
639         unsetMacaddress();
640       } else {
641         setMacaddress((String)value);
642       }
643       break;
644
645     case RD:
646       if (value == null) {
647         unsetRd();
648       } else {
649         setRd((String)value);
650       }
651       break;
652
653     case PREFIX:
654       if (value == null) {
655         unsetPrefix();
656       } else {
657         setPrefix((String)value);
658       }
659       break;
660
661     case NEXTHOP:
662       if (value == null) {
663         unsetNexthop();
664       } else {
665         setNexthop((String)value);
666       }
667       break;
668
669     case ROUTERMAC:
670       if (value == null) {
671         unsetRoutermac();
672       } else {
673         setRoutermac((String)value);
674       }
675       break;
676
677     }
678   }
679
680   public Object getFieldValue(_Fields field) {
681     switch (field) {
682     case TYPE:
683       return Integer.valueOf(getType());
684
685     case RESERVED:
686       return Integer.valueOf(getReserved());
687
688     case PREFIXLEN:
689       return Integer.valueOf(getPrefixlen());
690
691     case L3LABEL:
692       return Integer.valueOf(getL3label());
693
694     case L2LABEL:
695       return Integer.valueOf(getL2label());
696
697     case ETHTAG:
698       return Integer.valueOf(getEthtag());
699
700     case ESI:
701       return getEsi();
702
703     case MACADDRESS:
704       return getMacaddress();
705
706     case RD:
707       return getRd();
708
709     case PREFIX:
710       return getPrefix();
711
712     case NEXTHOP:
713       return getNexthop();
714
715     case ROUTERMAC:
716       return getRoutermac();
717
718     }
719     throw new IllegalStateException();
720   }
721
722   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
723   public boolean isSet(_Fields field) {
724     if (field == null) {
725       throw new IllegalArgumentException();
726     }
727
728     switch (field) {
729     case TYPE:
730       return isSetType();
731     case RESERVED:
732       return isSetReserved();
733     case PREFIXLEN:
734       return isSetPrefixlen();
735     case L3LABEL:
736       return isSetL3label();
737     case L2LABEL:
738       return isSetL2label();
739     case ETHTAG:
740       return isSetEthtag();
741     case ESI:
742       return isSetEsi();
743     case MACADDRESS:
744       return isSetMacaddress();
745     case RD:
746       return isSetRd();
747     case PREFIX:
748       return isSetPrefix();
749     case NEXTHOP:
750       return isSetNexthop();
751     case ROUTERMAC:
752       return isSetRoutermac();
753     }
754     throw new IllegalStateException();
755   }
756
757   @Override
758   public boolean equals(Object that) {
759     if (that == null)
760       return false;
761     if (that instanceof Update)
762       return this.equals((Update)that);
763     return false;
764   }
765
766   public boolean equals(Update that) {
767     if (that == null)
768       return false;
769
770     boolean this_present_type = true;
771     boolean that_present_type = true;
772     if (this_present_type || that_present_type) {
773       if (!(this_present_type && that_present_type))
774         return false;
775       if (this.type != that.type)
776         return false;
777     }
778
779     boolean this_present_reserved = true;
780     boolean that_present_reserved = true;
781     if (this_present_reserved || that_present_reserved) {
782       if (!(this_present_reserved && that_present_reserved))
783         return false;
784       if (this.reserved != that.reserved)
785         return false;
786     }
787
788     boolean this_present_prefixlen = true;
789     boolean that_present_prefixlen = true;
790     if (this_present_prefixlen || that_present_prefixlen) {
791       if (!(this_present_prefixlen && that_present_prefixlen))
792         return false;
793       if (this.prefixlen != that.prefixlen)
794         return false;
795     }
796
797     boolean this_present_l3label = true;
798     boolean that_present_l3label = true;
799     if (this_present_l3label || that_present_l3label) {
800       if (!(this_present_l3label && that_present_l3label))
801         return false;
802       if (this.l3label != that.l3label)
803         return false;
804     }
805
806     boolean this_present_l2label = true;
807     boolean that_present_l2label = true;
808     if (this_present_l2label || that_present_l2label) {
809       if (!(this_present_l2label && that_present_l2label))
810         return false;
811       if (this.l2label != that.l2label)
812         return false;
813     }
814
815     boolean this_present_ethtag = true;
816     boolean that_present_ethtag = true;
817     if (this_present_ethtag || that_present_ethtag) {
818       if (!(this_present_ethtag && that_present_ethtag))
819         return false;
820       if (this.ethtag != that.ethtag)
821         return false;
822     }
823
824     boolean this_present_esi = true && this.isSetEsi();
825     boolean that_present_esi = true && that.isSetEsi();
826     if (this_present_esi || that_present_esi) {
827       if (!(this_present_esi && that_present_esi))
828         return false;
829       if (!this.esi.equals(that.esi))
830         return false;
831     }
832
833     boolean this_present_macaddress = true && this.isSetMacaddress();
834     boolean that_present_macaddress = true && that.isSetMacaddress();
835     if (this_present_macaddress || that_present_macaddress) {
836       if (!(this_present_macaddress && that_present_macaddress))
837         return false;
838       if (!this.macaddress.equals(that.macaddress))
839         return false;
840     }
841
842     boolean this_present_rd = true && this.isSetRd();
843     boolean that_present_rd = true && that.isSetRd();
844     if (this_present_rd || that_present_rd) {
845       if (!(this_present_rd && that_present_rd))
846         return false;
847       if (!this.rd.equals(that.rd))
848         return false;
849     }
850
851     boolean this_present_prefix = true && this.isSetPrefix();
852     boolean that_present_prefix = true && that.isSetPrefix();
853     if (this_present_prefix || that_present_prefix) {
854       if (!(this_present_prefix && that_present_prefix))
855         return false;
856       if (!this.prefix.equals(that.prefix))
857         return false;
858     }
859
860     boolean this_present_nexthop = true && this.isSetNexthop();
861     boolean that_present_nexthop = true && that.isSetNexthop();
862     if (this_present_nexthop || that_present_nexthop) {
863       if (!(this_present_nexthop && that_present_nexthop))
864         return false;
865       if (!this.nexthop.equals(that.nexthop))
866         return false;
867     }
868
869     boolean this_present_routermac = true && this.isSetRoutermac();
870     boolean that_present_routermac = true && that.isSetRoutermac();
871     if (this_present_routermac || that_present_routermac) {
872       if (!(this_present_routermac && that_present_routermac))
873         return false;
874       if (!this.routermac.equals(that.routermac))
875         return false;
876     }
877
878     return true;
879   }
880
881   @Override
882   public int hashCode() {
883     List<Object> list = new ArrayList<Object>();
884     boolean present_type = true;
885     list.add(present_type);
886     if (present_type)
887       list.add(type);
888     boolean present_reserved = true;
889     list.add(present_reserved);
890     if (present_reserved)
891       list.add(reserved);
892     boolean present_prefixlen = true;
893     list.add(present_prefixlen);
894     if (present_prefixlen)
895       list.add(prefixlen);
896     boolean present_l3label = true;
897     list.add(present_l3label);
898     if (present_l3label)
899       list.add(l3label);
900     boolean present_l2label = true;
901     list.add(present_l2label);
902     if (present_l2label)
903       list.add(l2label);
904     boolean present_ethtag = true;
905     list.add(present_ethtag);
906     if (present_ethtag)
907       list.add(ethtag);
908     boolean present_esi = true && (isSetEsi());
909     list.add(present_esi);
910     if (present_esi)
911       list.add(esi);
912     boolean present_macaddress = true && (isSetMacaddress());
913     list.add(present_macaddress);
914     if (present_macaddress)
915       list.add(macaddress);
916     boolean present_rd = true && (isSetRd());
917     list.add(present_rd);
918     if (present_rd)
919       list.add(rd);
920     boolean present_prefix = true && (isSetPrefix());
921     list.add(present_prefix);
922     if (present_prefix)
923       list.add(prefix);
924     boolean present_nexthop = true && (isSetNexthop());
925     list.add(present_nexthop);
926     if (present_nexthop)
927       list.add(nexthop);
928     boolean present_routermac = true && (isSetRoutermac());
929     list.add(present_routermac);
930     if (present_routermac)
931       list.add(routermac);
932     return list.hashCode();
933   }
934
935   @Override
936   public int compareTo(Update other) {
937     if (!getClass().equals(other.getClass())) {
938       return getClass().getName().compareTo(other.getClass().getName());
939     }
940
941     int lastComparison = 0;
942
943     lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
944     if (lastComparison != 0) {
945       return lastComparison;
946     }
947     if (isSetType()) {
948       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
949       if (lastComparison != 0) {
950         return lastComparison;
951       }
952     }
953     lastComparison = Boolean.valueOf(isSetReserved()).compareTo(other.isSetReserved());
954     if (lastComparison != 0) {
955       return lastComparison;
956     }
957     if (isSetReserved()) {
958       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, other.reserved);
959       if (lastComparison != 0) {
960         return lastComparison;
961       }
962     }
963     lastComparison = Boolean.valueOf(isSetPrefixlen()).compareTo(other.isSetPrefixlen());
964     if (lastComparison != 0) {
965       return lastComparison;
966     }
967     if (isSetPrefixlen()) {
968       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefixlen, other.prefixlen);
969       if (lastComparison != 0) {
970         return lastComparison;
971       }
972     }
973     lastComparison = Boolean.valueOf(isSetL3label()).compareTo(other.isSetL3label());
974     if (lastComparison != 0) {
975       return lastComparison;
976     }
977     if (isSetL3label()) {
978       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.l3label, other.l3label);
979       if (lastComparison != 0) {
980         return lastComparison;
981       }
982     }
983     lastComparison = Boolean.valueOf(isSetL2label()).compareTo(other.isSetL2label());
984     if (lastComparison != 0) {
985       return lastComparison;
986     }
987     if (isSetL2label()) {
988       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.l2label, other.l2label);
989       if (lastComparison != 0) {
990         return lastComparison;
991       }
992     }
993     lastComparison = Boolean.valueOf(isSetEthtag()).compareTo(other.isSetEthtag());
994     if (lastComparison != 0) {
995       return lastComparison;
996     }
997     if (isSetEthtag()) {
998       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ethtag, other.ethtag);
999       if (lastComparison != 0) {
1000         return lastComparison;
1001       }
1002     }
1003     lastComparison = Boolean.valueOf(isSetEsi()).compareTo(other.isSetEsi());
1004     if (lastComparison != 0) {
1005       return lastComparison;
1006     }
1007     if (isSetEsi()) {
1008       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.esi, other.esi);
1009       if (lastComparison != 0) {
1010         return lastComparison;
1011       }
1012     }
1013     lastComparison = Boolean.valueOf(isSetMacaddress()).compareTo(other.isSetMacaddress());
1014     if (lastComparison != 0) {
1015       return lastComparison;
1016     }
1017     if (isSetMacaddress()) {
1018       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.macaddress, other.macaddress);
1019       if (lastComparison != 0) {
1020         return lastComparison;
1021       }
1022     }
1023     lastComparison = Boolean.valueOf(isSetRd()).compareTo(other.isSetRd());
1024     if (lastComparison != 0) {
1025       return lastComparison;
1026     }
1027     if (isSetRd()) {
1028       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rd, other.rd);
1029       if (lastComparison != 0) {
1030         return lastComparison;
1031       }
1032     }
1033     lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(other.isSetPrefix());
1034     if (lastComparison != 0) {
1035       return lastComparison;
1036     }
1037     if (isSetPrefix()) {
1038       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, other.prefix);
1039       if (lastComparison != 0) {
1040         return lastComparison;
1041       }
1042     }
1043     lastComparison = Boolean.valueOf(isSetNexthop()).compareTo(other.isSetNexthop());
1044     if (lastComparison != 0) {
1045       return lastComparison;
1046     }
1047     if (isSetNexthop()) {
1048       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nexthop, other.nexthop);
1049       if (lastComparison != 0) {
1050         return lastComparison;
1051       }
1052     }
1053     lastComparison = Boolean.valueOf(isSetRoutermac()).compareTo(other.isSetRoutermac());
1054     if (lastComparison != 0) {
1055       return lastComparison;
1056     }
1057     if (isSetRoutermac()) {
1058       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.routermac, other.routermac);
1059       if (lastComparison != 0) {
1060         return lastComparison;
1061       }
1062     }
1063     return 0;
1064   }
1065
1066   public _Fields fieldForId(int fieldId) {
1067     return _Fields.findByThriftId(fieldId);
1068   }
1069
1070   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1071     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
1072   }
1073
1074   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1075     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
1076   }
1077
1078   @Override
1079   public String toString() {
1080     StringBuilder sb = new StringBuilder("Update(");
1081     boolean first = true;
1082
1083     sb.append("type:");
1084     sb.append(this.type);
1085     first = false;
1086     if (!first) sb.append(", ");
1087     sb.append("reserved:");
1088     sb.append(this.reserved);
1089     first = false;
1090     if (!first) sb.append(", ");
1091     sb.append("prefixlen:");
1092     sb.append(this.prefixlen);
1093     first = false;
1094     if (!first) sb.append(", ");
1095     sb.append("l3label:");
1096     sb.append(this.l3label);
1097     first = false;
1098     if (!first) sb.append(", ");
1099     sb.append("l2label:");
1100     sb.append(this.l2label);
1101     first = false;
1102     if (!first) sb.append(", ");
1103     sb.append("ethtag:");
1104     sb.append(this.ethtag);
1105     first = false;
1106     if (!first) sb.append(", ");
1107     sb.append("esi:");
1108     if (this.esi == null) {
1109       sb.append("null");
1110     } else {
1111       sb.append(this.esi);
1112     }
1113     first = false;
1114     if (!first) sb.append(", ");
1115     sb.append("macaddress:");
1116     if (this.macaddress == null) {
1117       sb.append("null");
1118     } else {
1119       sb.append(this.macaddress);
1120     }
1121     first = false;
1122     if (!first) sb.append(", ");
1123     sb.append("rd:");
1124     if (this.rd == null) {
1125       sb.append("null");
1126     } else {
1127       sb.append(this.rd);
1128     }
1129     first = false;
1130     if (!first) sb.append(", ");
1131     sb.append("prefix:");
1132     if (this.prefix == null) {
1133       sb.append("null");
1134     } else {
1135       sb.append(this.prefix);
1136     }
1137     first = false;
1138     if (!first) sb.append(", ");
1139     sb.append("nexthop:");
1140     if (this.nexthop == null) {
1141       sb.append("null");
1142     } else {
1143       sb.append(this.nexthop);
1144     }
1145     first = false;
1146     if (!first) sb.append(", ");
1147     sb.append("routermac:");
1148     if (this.routermac == null) {
1149       sb.append("null");
1150     } else {
1151       sb.append(this.routermac);
1152     }
1153     first = false;
1154     sb.append(")");
1155     return sb.toString();
1156   }
1157
1158   public void validate() throws org.apache.thrift.TException {
1159     // check for required fields
1160     // check for sub-struct validity
1161   }
1162
1163   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1164     try {
1165       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1166     } catch (org.apache.thrift.TException te) {
1167       throw new java.io.IOException(te);
1168     }
1169   }
1170
1171   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1172     try {
1173       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1174       __isset_bitfield = 0;
1175       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1176     } catch (org.apache.thrift.TException te) {
1177       throw new java.io.IOException(te);
1178     }
1179   }
1180
1181   private static class UpdateStandardSchemeFactory implements SchemeFactory {
1182     public UpdateStandardScheme getScheme() {
1183       return new UpdateStandardScheme();
1184     }
1185   }
1186
1187   private static class UpdateStandardScheme extends StandardScheme<Update> {
1188
1189     public void read(org.apache.thrift.protocol.TProtocol iprot, Update struct) throws org.apache.thrift.TException {
1190       org.apache.thrift.protocol.TField schemeField;
1191       iprot.readStructBegin();
1192       while (true)
1193       {
1194         schemeField = iprot.readFieldBegin();
1195         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
1196           break;
1197         }
1198         switch (schemeField.id) {
1199           case 1: // TYPE
1200             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1201               struct.type = iprot.readI32();
1202               struct.setTypeIsSet(true);
1203             } else { 
1204               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1205             }
1206             break;
1207           case 2: // RESERVED
1208             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1209               struct.reserved = iprot.readI32();
1210               struct.setReservedIsSet(true);
1211             } else { 
1212               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1213             }
1214             break;
1215           case 3: // PREFIXLEN
1216             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1217               struct.prefixlen = iprot.readI32();
1218               struct.setPrefixlenIsSet(true);
1219             } else { 
1220               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1221             }
1222             break;
1223           case 4: // L3LABEL
1224             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1225               struct.l3label = iprot.readI32();
1226               struct.setL3labelIsSet(true);
1227             } else { 
1228               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1229             }
1230             break;
1231           case 5: // L2LABEL
1232             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1233               struct.l2label = iprot.readI32();
1234               struct.setL2labelIsSet(true);
1235             } else { 
1236               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1237             }
1238             break;
1239           case 6: // ETHTAG
1240             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
1241               struct.ethtag = iprot.readI32();
1242               struct.setEthtagIsSet(true);
1243             } else { 
1244               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1245             }
1246             break;
1247           case 7: // ESI
1248             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1249               struct.esi = iprot.readString();
1250               struct.setEsiIsSet(true);
1251             } else { 
1252               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1253             }
1254             break;
1255           case 8: // MACADDRESS
1256             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1257               struct.macaddress = iprot.readString();
1258               struct.setMacaddressIsSet(true);
1259             } else { 
1260               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1261             }
1262             break;
1263           case 9: // RD
1264             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1265               struct.rd = iprot.readString();
1266               struct.setRdIsSet(true);
1267             } else { 
1268               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1269             }
1270             break;
1271           case 10: // PREFIX
1272             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1273               struct.prefix = iprot.readString();
1274               struct.setPrefixIsSet(true);
1275             } else { 
1276               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1277             }
1278             break;
1279           case 11: // NEXTHOP
1280             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1281               struct.nexthop = iprot.readString();
1282               struct.setNexthopIsSet(true);
1283             } else { 
1284               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1285             }
1286             break;
1287           case 12: // ROUTERMAC
1288             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
1289               struct.routermac = iprot.readString();
1290               struct.setRoutermacIsSet(true);
1291             } else { 
1292               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1293             }
1294             break;
1295           default:
1296             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
1297         }
1298         iprot.readFieldEnd();
1299       }
1300       iprot.readStructEnd();
1301
1302       // check for required fields of primitive type, which can't be checked in the validate method
1303       struct.validate();
1304     }
1305
1306     public void write(org.apache.thrift.protocol.TProtocol oprot, Update struct) throws org.apache.thrift.TException {
1307       struct.validate();
1308
1309       oprot.writeStructBegin(STRUCT_DESC);
1310       oprot.writeFieldBegin(TYPE_FIELD_DESC);
1311       oprot.writeI32(struct.type);
1312       oprot.writeFieldEnd();
1313       oprot.writeFieldBegin(RESERVED_FIELD_DESC);
1314       oprot.writeI32(struct.reserved);
1315       oprot.writeFieldEnd();
1316       oprot.writeFieldBegin(PREFIXLEN_FIELD_DESC);
1317       oprot.writeI32(struct.prefixlen);
1318       oprot.writeFieldEnd();
1319       oprot.writeFieldBegin(L3LABEL_FIELD_DESC);
1320       oprot.writeI32(struct.l3label);
1321       oprot.writeFieldEnd();
1322       oprot.writeFieldBegin(L2LABEL_FIELD_DESC);
1323       oprot.writeI32(struct.l2label);
1324       oprot.writeFieldEnd();
1325       oprot.writeFieldBegin(ETHTAG_FIELD_DESC);
1326       oprot.writeI32(struct.ethtag);
1327       oprot.writeFieldEnd();
1328       if (struct.esi != null) {
1329         oprot.writeFieldBegin(ESI_FIELD_DESC);
1330         oprot.writeString(struct.esi);
1331         oprot.writeFieldEnd();
1332       }
1333       if (struct.macaddress != null) {
1334         oprot.writeFieldBegin(MACADDRESS_FIELD_DESC);
1335         oprot.writeString(struct.macaddress);
1336         oprot.writeFieldEnd();
1337       }
1338       if (struct.rd != null) {
1339         oprot.writeFieldBegin(RD_FIELD_DESC);
1340         oprot.writeString(struct.rd);
1341         oprot.writeFieldEnd();
1342       }
1343       if (struct.prefix != null) {
1344         oprot.writeFieldBegin(PREFIX_FIELD_DESC);
1345         oprot.writeString(struct.prefix);
1346         oprot.writeFieldEnd();
1347       }
1348       if (struct.nexthop != null) {
1349         oprot.writeFieldBegin(NEXTHOP_FIELD_DESC);
1350         oprot.writeString(struct.nexthop);
1351         oprot.writeFieldEnd();
1352       }
1353       if (struct.routermac != null) {
1354         oprot.writeFieldBegin(ROUTERMAC_FIELD_DESC);
1355         oprot.writeString(struct.routermac);
1356         oprot.writeFieldEnd();
1357       }
1358       oprot.writeFieldStop();
1359       oprot.writeStructEnd();
1360     }
1361
1362   }
1363
1364   private static class UpdateTupleSchemeFactory implements SchemeFactory {
1365     public UpdateTupleScheme getScheme() {
1366       return new UpdateTupleScheme();
1367     }
1368   }
1369
1370   private static class UpdateTupleScheme extends TupleScheme<Update> {
1371
1372     @Override
1373     public void write(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException {
1374       TTupleProtocol oprot = (TTupleProtocol) prot;
1375       BitSet optionals = new BitSet();
1376       if (struct.isSetType()) {
1377         optionals.set(0);
1378       }
1379       if (struct.isSetReserved()) {
1380         optionals.set(1);
1381       }
1382       if (struct.isSetPrefixlen()) {
1383         optionals.set(2);
1384       }
1385       if (struct.isSetL3label()) {
1386         optionals.set(3);
1387       }
1388       if (struct.isSetL2label()) {
1389         optionals.set(4);
1390       }
1391       if (struct.isSetEthtag()) {
1392         optionals.set(5);
1393       }
1394       if (struct.isSetEsi()) {
1395         optionals.set(6);
1396       }
1397       if (struct.isSetMacaddress()) {
1398         optionals.set(7);
1399       }
1400       if (struct.isSetRd()) {
1401         optionals.set(8);
1402       }
1403       if (struct.isSetPrefix()) {
1404         optionals.set(9);
1405       }
1406       if (struct.isSetNexthop()) {
1407         optionals.set(10);
1408       }
1409       if (struct.isSetRoutermac()) {
1410         optionals.set(11);
1411       }
1412       oprot.writeBitSet(optionals, 12);
1413       if (struct.isSetType()) {
1414         oprot.writeI32(struct.type);
1415       }
1416       if (struct.isSetReserved()) {
1417         oprot.writeI32(struct.reserved);
1418       }
1419       if (struct.isSetPrefixlen()) {
1420         oprot.writeI32(struct.prefixlen);
1421       }
1422       if (struct.isSetL3label()) {
1423         oprot.writeI32(struct.l3label);
1424       }
1425       if (struct.isSetL2label()) {
1426         oprot.writeI32(struct.l2label);
1427       }
1428       if (struct.isSetEthtag()) {
1429         oprot.writeI32(struct.ethtag);
1430       }
1431       if (struct.isSetEsi()) {
1432         oprot.writeString(struct.esi);
1433       }
1434       if (struct.isSetMacaddress()) {
1435         oprot.writeString(struct.macaddress);
1436       }
1437       if (struct.isSetRd()) {
1438         oprot.writeString(struct.rd);
1439       }
1440       if (struct.isSetPrefix()) {
1441         oprot.writeString(struct.prefix);
1442       }
1443       if (struct.isSetNexthop()) {
1444         oprot.writeString(struct.nexthop);
1445       }
1446       if (struct.isSetRoutermac()) {
1447         oprot.writeString(struct.routermac);
1448       }
1449     }
1450
1451     @Override
1452     public void read(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException {
1453       TTupleProtocol iprot = (TTupleProtocol) prot;
1454       BitSet incoming = iprot.readBitSet(12);
1455       if (incoming.get(0)) {
1456         struct.type = iprot.readI32();
1457         struct.setTypeIsSet(true);
1458       }
1459       if (incoming.get(1)) {
1460         struct.reserved = iprot.readI32();
1461         struct.setReservedIsSet(true);
1462       }
1463       if (incoming.get(2)) {
1464         struct.prefixlen = iprot.readI32();
1465         struct.setPrefixlenIsSet(true);
1466       }
1467       if (incoming.get(3)) {
1468         struct.l3label = iprot.readI32();
1469         struct.setL3labelIsSet(true);
1470       }
1471       if (incoming.get(4)) {
1472         struct.l2label = iprot.readI32();
1473         struct.setL2labelIsSet(true);
1474       }
1475       if (incoming.get(5)) {
1476         struct.ethtag = iprot.readI32();
1477         struct.setEthtagIsSet(true);
1478       }
1479       if (incoming.get(6)) {
1480         struct.esi = iprot.readString();
1481         struct.setEsiIsSet(true);
1482       }
1483       if (incoming.get(7)) {
1484         struct.macaddress = iprot.readString();
1485         struct.setMacaddressIsSet(true);
1486       }
1487       if (incoming.get(8)) {
1488         struct.rd = iprot.readString();
1489         struct.setRdIsSet(true);
1490       }
1491       if (incoming.get(9)) {
1492         struct.prefix = iprot.readString();
1493         struct.setPrefixIsSet(true);
1494       }
1495       if (incoming.get(10)) {
1496         struct.nexthop = iprot.readString();
1497         struct.setNexthopIsSet(true);
1498       }
1499       if (incoming.get(11)) {
1500         struct.routermac = iprot.readString();
1501         struct.setRoutermacIsSet(true);
1502       }
1503     }
1504   }
1505
1506 }
1507