ELAN: skip remote unicast MACs
[netvirt.git] / bgpmanager / bgpmanager-impl / src / main / java / org / opendaylight / netvirt / bgpmanager / thrift / gen / Routes.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 Routes implements org.apache.thrift.TBase<Routes, Routes._Fields>, java.io.Serializable, Cloneable, Comparable<Routes> {
38   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Routes");
39
40   private static final org.apache.thrift.protocol.TField ERRCODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errcode", org.apache.thrift.protocol.TType.I32, (short)1);
41   private static final org.apache.thrift.protocol.TField UPDATES_FIELD_DESC = new org.apache.thrift.protocol.TField("updates", org.apache.thrift.protocol.TType.LIST, (short)2);
42   private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.I32, (short)4);
43
44   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
45   static {
46     schemes.put(StandardScheme.class, new RoutesStandardSchemeFactory());
47     schemes.put(TupleScheme.class, new RoutesTupleSchemeFactory());
48   }
49
50   public int errcode; // required
51   public List<Update> updates; // optional
52   public int more; // optional
53
54   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
55   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
56     ERRCODE((short)1, "errcode"),
57     UPDATES((short)2, "updates"),
58     MORE((short)4, "more");
59
60     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
62     static {
63       for (_Fields field : EnumSet.allOf(_Fields.class)) {
64         byName.put(field.getFieldName(), field);
65       }
66     }
67
68     /**
69      * Find the _Fields constant that matches fieldId, or null if its not found.
70      */
71     public static _Fields findByThriftId(int fieldId) {
72       switch(fieldId) {
73         case 1: // ERRCODE
74           return ERRCODE;
75         case 2: // UPDATES
76           return UPDATES;
77         case 4: // MORE
78           return MORE;
79         default:
80           return null;
81       }
82     }
83
84     /**
85      * Find the _Fields constant that matches fieldId, throwing an exception
86      * if it is not found.
87      */
88     public static _Fields findByThriftIdOrThrow(int fieldId) {
89       _Fields fields = findByThriftId(fieldId);
90       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
91       return fields;
92     }
93
94     /**
95      * Find the _Fields constant that matches name, or null if its not found.
96      */
97     public static _Fields findByName(String name) {
98       return byName.get(name);
99     }
100
101     private final short _thriftId;
102     private final String _fieldName;
103
104     _Fields(short thriftId, String fieldName) {
105       _thriftId = thriftId;
106       _fieldName = fieldName;
107     }
108
109     public short getThriftFieldId() {
110       return _thriftId;
111     }
112
113     public String getFieldName() {
114       return _fieldName;
115     }
116   }
117
118   // isset id assignments
119   private static final int __ERRCODE_ISSET_ID = 0;
120   private static final int __MORE_ISSET_ID = 1;
121   private byte __isset_bitfield = 0;
122   private static final _Fields optionals[] = {_Fields.UPDATES,_Fields.MORE};
123   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
124   static {
125     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
126     tmpMap.put(_Fields.ERRCODE, new org.apache.thrift.meta_data.FieldMetaData("errcode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
128     tmpMap.put(_Fields.UPDATES, new org.apache.thrift.meta_data.FieldMetaData("updates", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
129         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
130             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Update.class))));
131     tmpMap.put(_Fields.MORE, new org.apache.thrift.meta_data.FieldMetaData("more", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
132         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
133     metaDataMap = Collections.unmodifiableMap(tmpMap);
134     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Routes.class, metaDataMap);
135   }
136
137   public Routes() {
138   }
139
140   public Routes(
141     int errcode)
142   {
143     this();
144     this.errcode = errcode;
145     setErrcodeIsSet(true);
146   }
147
148   /**
149    * Performs a deep copy on <i>other</i>.
150    */
151   public Routes(Routes other) {
152     __isset_bitfield = other.__isset_bitfield;
153     this.errcode = other.errcode;
154     if (other.isSetUpdates()) {
155       List<Update> __this__updates = new ArrayList<Update>(other.updates.size());
156       for (Update other_element : other.updates) {
157         __this__updates.add(new Update(other_element));
158       }
159       this.updates = __this__updates;
160     }
161     this.more = other.more;
162   }
163
164   public Routes deepCopy() {
165     return new Routes(this);
166   }
167
168   @Override
169   public void clear() {
170     setErrcodeIsSet(false);
171     this.errcode = 0;
172     this.updates = null;
173     setMoreIsSet(false);
174     this.more = 0;
175   }
176
177   public int getErrcode() {
178     return this.errcode;
179   }
180
181   public Routes setErrcode(int errcode) {
182     this.errcode = errcode;
183     setErrcodeIsSet(true);
184     return this;
185   }
186
187   public void unsetErrcode() {
188     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRCODE_ISSET_ID);
189   }
190
191   /** Returns true if field errcode is set (has been assigned a value) and false otherwise */
192   public boolean isSetErrcode() {
193     return EncodingUtils.testBit(__isset_bitfield, __ERRCODE_ISSET_ID);
194   }
195
196   public void setErrcodeIsSet(boolean value) {
197     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRCODE_ISSET_ID, value);
198   }
199
200   public int getUpdatesSize() {
201     return (this.updates == null) ? 0 : this.updates.size();
202   }
203
204   public java.util.Iterator<Update> getUpdatesIterator() {
205     return (this.updates == null) ? null : this.updates.iterator();
206   }
207
208   public void addToUpdates(Update elem) {
209     if (this.updates == null) {
210       this.updates = new ArrayList<Update>();
211     }
212     this.updates.add(elem);
213   }
214
215   public List<Update> getUpdates() {
216     return this.updates;
217   }
218
219   public Routes setUpdates(List<Update> updates) {
220     this.updates = updates;
221     return this;
222   }
223
224   public void unsetUpdates() {
225     this.updates = null;
226   }
227
228   /** Returns true if field updates is set (has been assigned a value) and false otherwise */
229   public boolean isSetUpdates() {
230     return this.updates != null;
231   }
232
233   public void setUpdatesIsSet(boolean value) {
234     if (!value) {
235       this.updates = null;
236     }
237   }
238
239   public int getMore() {
240     return this.more;
241   }
242
243   public Routes setMore(int more) {
244     this.more = more;
245     setMoreIsSet(true);
246     return this;
247   }
248
249   public void unsetMore() {
250     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MORE_ISSET_ID);
251   }
252
253   /** Returns true if field more is set (has been assigned a value) and false otherwise */
254   public boolean isSetMore() {
255     return EncodingUtils.testBit(__isset_bitfield, __MORE_ISSET_ID);
256   }
257
258   public void setMoreIsSet(boolean value) {
259     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MORE_ISSET_ID, value);
260   }
261
262   public void setFieldValue(_Fields field, Object value) {
263     switch (field) {
264     case ERRCODE:
265       if (value == null) {
266         unsetErrcode();
267       } else {
268         setErrcode((Integer)value);
269       }
270       break;
271
272     case UPDATES:
273       if (value == null) {
274         unsetUpdates();
275       } else {
276         setUpdates((List<Update>)value);
277       }
278       break;
279
280     case MORE:
281       if (value == null) {
282         unsetMore();
283       } else {
284         setMore((Integer)value);
285       }
286       break;
287
288     }
289   }
290
291   public Object getFieldValue(_Fields field) {
292     switch (field) {
293     case ERRCODE:
294       return Integer.valueOf(getErrcode());
295
296     case UPDATES:
297       return getUpdates();
298
299     case MORE:
300       return Integer.valueOf(getMore());
301
302     }
303     throw new IllegalStateException();
304   }
305
306   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
307   public boolean isSet(_Fields field) {
308     if (field == null) {
309       throw new IllegalArgumentException();
310     }
311
312     switch (field) {
313     case ERRCODE:
314       return isSetErrcode();
315     case UPDATES:
316       return isSetUpdates();
317     case MORE:
318       return isSetMore();
319     }
320     throw new IllegalStateException();
321   }
322
323   @Override
324   public boolean equals(Object that) {
325     if (that == null)
326       return false;
327     if (that instanceof Routes)
328       return this.equals((Routes)that);
329     return false;
330   }
331
332   public boolean equals(Routes that) {
333     if (that == null)
334       return false;
335
336     boolean this_present_errcode = true;
337     boolean that_present_errcode = true;
338     if (this_present_errcode || that_present_errcode) {
339       if (!(this_present_errcode && that_present_errcode))
340         return false;
341       if (this.errcode != that.errcode)
342         return false;
343     }
344
345     boolean this_present_updates = true && this.isSetUpdates();
346     boolean that_present_updates = true && that.isSetUpdates();
347     if (this_present_updates || that_present_updates) {
348       if (!(this_present_updates && that_present_updates))
349         return false;
350       if (!this.updates.equals(that.updates))
351         return false;
352     }
353
354     boolean this_present_more = true && this.isSetMore();
355     boolean that_present_more = true && that.isSetMore();
356     if (this_present_more || that_present_more) {
357       if (!(this_present_more && that_present_more))
358         return false;
359       if (this.more != that.more)
360         return false;
361     }
362
363     return true;
364   }
365
366   @Override
367   public int hashCode() {
368     List<Object> list = new ArrayList<Object>();
369
370     boolean present_errcode = true;
371     list.add(present_errcode);
372     if (present_errcode)
373       list.add(errcode);
374     boolean present_updates = true && (isSetUpdates());
375     list.add(present_updates);
376     if (present_updates)
377       list.add(updates);
378     boolean present_more = true && (isSetMore());
379     list.add(present_more);
380     if (present_more)
381       list.add(more);
382     return list.hashCode();
383   }
384
385   @Override
386   public int compareTo(Routes other) {
387     if (!getClass().equals(other.getClass())) {
388       return getClass().getName().compareTo(other.getClass().getName());
389     }
390
391     int lastComparison = 0;
392
393     lastComparison = Boolean.valueOf(isSetErrcode()).compareTo(other.isSetErrcode());
394     if (lastComparison != 0) {
395       return lastComparison;
396     }
397     if (isSetErrcode()) {
398       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errcode, other.errcode);
399       if (lastComparison != 0) {
400         return lastComparison;
401       }
402     }
403     lastComparison = Boolean.valueOf(isSetUpdates()).compareTo(other.isSetUpdates());
404     if (lastComparison != 0) {
405       return lastComparison;
406     }
407     if (isSetUpdates()) {
408       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updates, other.updates);
409       if (lastComparison != 0) {
410         return lastComparison;
411       }
412     }
413     lastComparison = Boolean.valueOf(isSetMore()).compareTo(other.isSetMore());
414     if (lastComparison != 0) {
415       return lastComparison;
416     }
417     if (isSetMore()) {
418       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.more, other.more);
419       if (lastComparison != 0) {
420         return lastComparison;
421       }
422     }
423     return 0;
424   }
425
426   public _Fields fieldForId(int fieldId) {
427     return _Fields.findByThriftId(fieldId);
428   }
429
430   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
431     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
432   }
433
434   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
435     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
436   }
437
438   @Override
439   public String toString() {
440     StringBuilder sb = new StringBuilder("Routes(");
441     boolean first = true;
442
443     sb.append("errcode:");
444     sb.append(this.errcode);
445     first = false;
446     if (isSetUpdates()) {
447       if (!first) sb.append(", ");
448       sb.append("updates:");
449       if (this.updates == null) {
450         sb.append("null");
451       } else {
452         sb.append(this.updates);
453       }
454       first = false;
455     }
456     if (isSetMore()) {
457       if (!first) sb.append(", ");
458       sb.append("more:");
459       sb.append(this.more);
460       first = false;
461     }
462     sb.append(")");
463     return sb.toString();
464   }
465
466   public void validate() throws org.apache.thrift.TException {
467     // check for required fields
468     // check for sub-struct validity
469   }
470
471   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
472     try {
473       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
474     } catch (org.apache.thrift.TException te) {
475       throw new java.io.IOException(te);
476     }
477   }
478
479   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
480     try {
481       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
482       __isset_bitfield = 0;
483       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
484     } catch (org.apache.thrift.TException te) {
485       throw new java.io.IOException(te);
486     }
487   }
488
489   private static class RoutesStandardSchemeFactory implements SchemeFactory {
490     public RoutesStandardScheme getScheme() {
491       return new RoutesStandardScheme();
492     }
493   }
494
495   private static class RoutesStandardScheme extends StandardScheme<Routes> {
496
497     public void read(org.apache.thrift.protocol.TProtocol iprot, Routes struct) throws org.apache.thrift.TException {
498       org.apache.thrift.protocol.TField schemeField;
499       iprot.readStructBegin();
500       while (true)
501       {
502         schemeField = iprot.readFieldBegin();
503         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
504           break;
505         }
506         switch (schemeField.id) {
507           case 1: // ERRCODE
508             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
509               struct.errcode = iprot.readI32();
510               struct.setErrcodeIsSet(true);
511             } else { 
512               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
513             }
514             break;
515           case 2: // UPDATES
516             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
517               {
518                 org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
519                 struct.updates = new ArrayList<Update>(_list0.size);
520                 for (int _i1 = 0; _i1 < _list0.size; ++_i1)
521                 {
522                   Update _elem2;
523                   _elem2 = new Update();
524                   _elem2.read(iprot);
525                   struct.updates.add(_elem2);
526                 }
527                 iprot.readListEnd();
528               }
529               struct.setUpdatesIsSet(true);
530             } else { 
531               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
532             }
533             break;
534           case 4: // MORE
535             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
536               struct.more = iprot.readI32();
537               struct.setMoreIsSet(true);
538             } else { 
539               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
540             }
541             break;
542           default:
543             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
544         }
545         iprot.readFieldEnd();
546       }
547       iprot.readStructEnd();
548
549       // check for required fields of primitive type, which can't be checked in the validate method
550       struct.validate();
551     }
552
553     public void write(org.apache.thrift.protocol.TProtocol oprot, Routes struct) throws org.apache.thrift.TException {
554       struct.validate();
555
556       oprot.writeStructBegin(STRUCT_DESC);
557       oprot.writeFieldBegin(ERRCODE_FIELD_DESC);
558       oprot.writeI32(struct.errcode);
559       oprot.writeFieldEnd();
560       if (struct.updates != null) {
561         if (struct.isSetUpdates()) {
562           oprot.writeFieldBegin(UPDATES_FIELD_DESC);
563           {
564             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.updates.size()));
565             for (Update _iter3 : struct.updates)
566             {
567               _iter3.write(oprot);
568             }
569             oprot.writeListEnd();
570           }
571           oprot.writeFieldEnd();
572         }
573       }
574       if (struct.isSetMore()) {
575         oprot.writeFieldBegin(MORE_FIELD_DESC);
576         oprot.writeI32(struct.more);
577         oprot.writeFieldEnd();
578       }
579       oprot.writeFieldStop();
580       oprot.writeStructEnd();
581     }
582
583   }
584
585   private static class RoutesTupleSchemeFactory implements SchemeFactory {
586     public RoutesTupleScheme getScheme() {
587       return new RoutesTupleScheme();
588     }
589   }
590
591   private static class RoutesTupleScheme extends TupleScheme<Routes> {
592
593     @Override
594     public void write(org.apache.thrift.protocol.TProtocol prot, Routes struct) throws org.apache.thrift.TException {
595       TTupleProtocol oprot = (TTupleProtocol) prot;
596       BitSet optionals = new BitSet();
597       if (struct.isSetErrcode()) {
598         optionals.set(0);
599       }
600       if (struct.isSetUpdates()) {
601         optionals.set(1);
602       }
603       if (struct.isSetMore()) {
604         optionals.set(2);
605       }
606       oprot.writeBitSet(optionals, 3);
607       if (struct.isSetErrcode()) {
608         oprot.writeI32(struct.errcode);
609       }
610       if (struct.isSetUpdates()) {
611         {
612           oprot.writeI32(struct.updates.size());
613           for (Update _iter4 : struct.updates)
614           {
615             _iter4.write(oprot);
616           }
617         }
618       }
619       if (struct.isSetMore()) {
620         oprot.writeI32(struct.more);
621       }
622     }
623
624     @Override
625     public void read(org.apache.thrift.protocol.TProtocol prot, Routes struct) throws org.apache.thrift.TException {
626       TTupleProtocol iprot = (TTupleProtocol) prot;
627       BitSet incoming = iprot.readBitSet(3);
628       if (incoming.get(0)) {
629         struct.errcode = iprot.readI32();
630         struct.setErrcodeIsSet(true);
631       }
632       if (incoming.get(1)) {
633         {
634           org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
635           struct.updates = new ArrayList<Update>(_list5.size);
636           for (int _i6 = 0; _i6 < _list5.size; ++_i6)
637           {
638             Update _elem7;
639             _elem7 = new Update();
640             _elem7.read(iprot);
641             struct.updates.add(_elem7);
642           }
643         }
644         struct.setUpdatesIsSet(true);
645       }
646       if (incoming.get(2)) {
647         struct.more = iprot.readI32();
648         struct.setMoreIsSet(true);
649       }
650     }
651   }
652
653 }
654