/** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.opendaylight.bgpmanager.thrift.gen; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Update implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Update"); 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); 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); 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); 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); 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); 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); 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); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { schemes.put(StandardScheme.class, new UpdateStandardSchemeFactory()); schemes.put(TupleScheme.class, new UpdateTupleSchemeFactory()); } public int type; // required public int reserved; // required public int prefixlen; // required public int label; // required public String rd; // required public String prefix; // required public String nexthop; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TYPE((short)1, "type"), RESERVED((short)2, "reserved"), PREFIXLEN((short)3, "prefixlen"), LABEL((short)4, "label"), RD((short)5, "rd"), PREFIX((short)6, "prefix"), NEXTHOP((short)7, "nexthop"); private static final Map byName = new HashMap(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPE return TYPE; case 2: // RESERVED return RESERVED; case 3: // PREFIXLEN return PREFIXLEN; case 4: // LABEL return LABEL; case 5: // RD return RD; case 6: // PREFIX return PREFIX; case 7: // NEXTHOP return NEXTHOP; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TYPE_ISSET_ID = 0; private static final int __RESERVED_ISSET_ID = 1; private static final int __PREFIXLEN_ISSET_ID = 2; private static final int __LABEL_ISSET_ID = 3; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PREFIXLEN, new org.apache.thrift.meta_data.FieldMetaData("prefixlen", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.LABEL, new org.apache.thrift.meta_data.FieldMetaData("label", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.RD, new org.apache.thrift.meta_data.FieldMetaData("rd", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NEXTHOP, new org.apache.thrift.meta_data.FieldMetaData("nexthop", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Update.class, metaDataMap); } public Update() { } public Update( int type, int reserved, int prefixlen, int label, String rd, String prefix, String nexthop) { this(); this.type = type; setTypeIsSet(true); this.reserved = reserved; setReservedIsSet(true); this.prefixlen = prefixlen; setPrefixlenIsSet(true); this.label = label; setLabelIsSet(true); this.rd = rd; this.prefix = prefix; this.nexthop = nexthop; } /** * Performs a deep copy on other. */ public Update(Update other) { __isset_bitfield = other.__isset_bitfield; this.type = other.type; this.reserved = other.reserved; this.prefixlen = other.prefixlen; this.label = other.label; if (other.isSetRd()) { this.rd = other.rd; } if (other.isSetPrefix()) { this.prefix = other.prefix; } if (other.isSetNexthop()) { this.nexthop = other.nexthop; } } public Update deepCopy() { return new Update(this); } @Override public void clear() { setTypeIsSet(false); this.type = 0; setReservedIsSet(false); this.reserved = 0; setPrefixlenIsSet(false); this.prefixlen = 0; setLabelIsSet(false); this.label = 0; this.rd = null; this.prefix = null; this.nexthop = null; } public int getType() { return this.type; } public Update setType(int type) { this.type = type; setTypeIsSet(true); return this; } public void unsetType() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID); } /** Returns true if field type is set (has been assigned a value) and false otherwise */ public boolean isSetType() { return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID); } public void setTypeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value); } public int getReserved() { return this.reserved; } public Update setReserved(int reserved) { this.reserved = reserved; setReservedIsSet(true); return this; } public void unsetReserved() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESERVED_ISSET_ID); } /** Returns true if field reserved is set (has been assigned a value) and false otherwise */ public boolean isSetReserved() { return EncodingUtils.testBit(__isset_bitfield, __RESERVED_ISSET_ID); } public void setReservedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVED_ISSET_ID, value); } public int getPrefixlen() { return this.prefixlen; } public Update setPrefixlen(int prefixlen) { this.prefixlen = prefixlen; setPrefixlenIsSet(true); return this; } public void unsetPrefixlen() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PREFIXLEN_ISSET_ID); } /** Returns true if field prefixlen is set (has been assigned a value) and false otherwise */ public boolean isSetPrefixlen() { return EncodingUtils.testBit(__isset_bitfield, __PREFIXLEN_ISSET_ID); } public void setPrefixlenIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PREFIXLEN_ISSET_ID, value); } public int getLabel() { return this.label; } public Update setLabel(int label) { this.label = label; setLabelIsSet(true); return this; } public void unsetLabel() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LABEL_ISSET_ID); } /** Returns true if field label is set (has been assigned a value) and false otherwise */ public boolean isSetLabel() { return EncodingUtils.testBit(__isset_bitfield, __LABEL_ISSET_ID); } public void setLabelIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LABEL_ISSET_ID, value); } public String getRd() { return this.rd; } public Update setRd(String rd) { this.rd = rd; return this; } public void unsetRd() { this.rd = null; } /** Returns true if field rd is set (has been assigned a value) and false otherwise */ public boolean isSetRd() { return this.rd != null; } public void setRdIsSet(boolean value) { if (!value) { this.rd = null; } } public String getPrefix() { return this.prefix; } public Update setPrefix(String prefix) { this.prefix = prefix; return this; } public void unsetPrefix() { this.prefix = null; } /** Returns true if field prefix is set (has been assigned a value) and false otherwise */ public boolean isSetPrefix() { return this.prefix != null; } public void setPrefixIsSet(boolean value) { if (!value) { this.prefix = null; } } public String getNexthop() { return this.nexthop; } public Update setNexthop(String nexthop) { this.nexthop = nexthop; return this; } public void unsetNexthop() { this.nexthop = null; } /** Returns true if field nexthop is set (has been assigned a value) and false otherwise */ public boolean isSetNexthop() { return this.nexthop != null; } public void setNexthopIsSet(boolean value) { if (!value) { this.nexthop = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((Integer)value); } break; case RESERVED: if (value == null) { unsetReserved(); } else { setReserved((Integer)value); } break; case PREFIXLEN: if (value == null) { unsetPrefixlen(); } else { setPrefixlen((Integer)value); } break; case LABEL: if (value == null) { unsetLabel(); } else { setLabel((Integer)value); } break; case RD: if (value == null) { unsetRd(); } else { setRd((String)value); } break; case PREFIX: if (value == null) { unsetPrefix(); } else { setPrefix((String)value); } break; case NEXTHOP: if (value == null) { unsetNexthop(); } else { setNexthop((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return Integer.valueOf(getType()); case RESERVED: return Integer.valueOf(getReserved()); case PREFIXLEN: return Integer.valueOf(getPrefixlen()); case LABEL: return Integer.valueOf(getLabel()); case RD: return getRd(); case PREFIX: return getPrefix(); case NEXTHOP: return getNexthop(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case RESERVED: return isSetReserved(); case PREFIXLEN: return isSetPrefixlen(); case LABEL: return isSetLabel(); case RD: return isSetRd(); case PREFIX: return isSetPrefix(); case NEXTHOP: return isSetNexthop(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Update) return this.equals((Update)that); return false; } public boolean equals(Update that) { if (that == null) return false; boolean this_present_type = true; boolean that_present_type = true; if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (this.type != that.type) return false; } boolean this_present_reserved = true; boolean that_present_reserved = true; if (this_present_reserved || that_present_reserved) { if (!(this_present_reserved && that_present_reserved)) return false; if (this.reserved != that.reserved) return false; } boolean this_present_prefixlen = true; boolean that_present_prefixlen = true; if (this_present_prefixlen || that_present_prefixlen) { if (!(this_present_prefixlen && that_present_prefixlen)) return false; if (this.prefixlen != that.prefixlen) return false; } boolean this_present_label = true; boolean that_present_label = true; if (this_present_label || that_present_label) { if (!(this_present_label && that_present_label)) return false; if (this.label != that.label) return false; } boolean this_present_rd = true && this.isSetRd(); boolean that_present_rd = true && that.isSetRd(); if (this_present_rd || that_present_rd) { if (!(this_present_rd && that_present_rd)) return false; if (!this.rd.equals(that.rd)) return false; } boolean this_present_prefix = true && this.isSetPrefix(); boolean that_present_prefix = true && that.isSetPrefix(); if (this_present_prefix || that_present_prefix) { if (!(this_present_prefix && that_present_prefix)) return false; if (!this.prefix.equals(that.prefix)) return false; } boolean this_present_nexthop = true && this.isSetNexthop(); boolean that_present_nexthop = true && that.isSetNexthop(); if (this_present_nexthop || that_present_nexthop) { if (!(this_present_nexthop && that_present_nexthop)) return false; if (!this.nexthop.equals(that.nexthop)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(Update other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetReserved()).compareTo(other.isSetReserved()); if (lastComparison != 0) { return lastComparison; } if (isSetReserved()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, other.reserved); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPrefixlen()).compareTo(other.isSetPrefixlen()); if (lastComparison != 0) { return lastComparison; } if (isSetPrefixlen()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefixlen, other.prefixlen); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLabel()).compareTo(other.isSetLabel()); if (lastComparison != 0) { return lastComparison; } if (isSetLabel()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.label, other.label); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRd()).compareTo(other.isSetRd()); if (lastComparison != 0) { return lastComparison; } if (isSetRd()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rd, other.rd); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(other.isSetPrefix()); if (lastComparison != 0) { return lastComparison; } if (isSetPrefix()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, other.prefix); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNexthop()).compareTo(other.isSetNexthop()); if (lastComparison != 0) { return lastComparison; } if (isSetNexthop()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nexthop, other.nexthop); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("Update("); boolean first = true; sb.append("type:"); sb.append(this.type); first = false; if (!first) sb.append(", "); sb.append("reserved:"); sb.append(this.reserved); first = false; if (!first) sb.append(", "); sb.append("prefixlen:"); sb.append(this.prefixlen); first = false; if (!first) sb.append(", "); sb.append("label:"); sb.append(this.label); first = false; if (!first) sb.append(", "); sb.append("rd:"); if (this.rd == null) { sb.append("null"); } else { sb.append(this.rd); } first = false; if (!first) sb.append(", "); sb.append("prefix:"); if (this.prefix == null) { sb.append("null"); } else { sb.append(this.prefix); } first = false; if (!first) sb.append(", "); sb.append("nexthop:"); if (this.nexthop == null) { sb.append("null"); } else { sb.append(this.nexthop); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class UpdateStandardSchemeFactory implements SchemeFactory { public UpdateStandardScheme getScheme() { return new UpdateStandardScheme(); } } private static class UpdateStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, Update struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = iprot.readI32(); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RESERVED if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.reserved = iprot.readI32(); struct.setReservedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PREFIXLEN if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.prefixlen = iprot.readI32(); struct.setPrefixlenIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // LABEL if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.label = iprot.readI32(); struct.setLabelIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // RD if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.rd = iprot.readString(); struct.setRdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // PREFIX if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.prefix = iprot.readString(); struct.setPrefixIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // NEXTHOP if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nexthop = iprot.readString(); struct.setNexthopIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, Update struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type); oprot.writeFieldEnd(); oprot.writeFieldBegin(RESERVED_FIELD_DESC); oprot.writeI32(struct.reserved); oprot.writeFieldEnd(); oprot.writeFieldBegin(PREFIXLEN_FIELD_DESC); oprot.writeI32(struct.prefixlen); oprot.writeFieldEnd(); oprot.writeFieldBegin(LABEL_FIELD_DESC); oprot.writeI32(struct.label); oprot.writeFieldEnd(); if (struct.rd != null) { oprot.writeFieldBegin(RD_FIELD_DESC); oprot.writeString(struct.rd); oprot.writeFieldEnd(); } if (struct.prefix != null) { oprot.writeFieldBegin(PREFIX_FIELD_DESC); oprot.writeString(struct.prefix); oprot.writeFieldEnd(); } if (struct.nexthop != null) { oprot.writeFieldBegin(NEXTHOP_FIELD_DESC); oprot.writeString(struct.nexthop); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class UpdateTupleSchemeFactory implements SchemeFactory { public UpdateTupleScheme getScheme() { return new UpdateTupleScheme(); } } private static class UpdateTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetType()) { optionals.set(0); } if (struct.isSetReserved()) { optionals.set(1); } if (struct.isSetPrefixlen()) { optionals.set(2); } if (struct.isSetLabel()) { optionals.set(3); } if (struct.isSetRd()) { optionals.set(4); } if (struct.isSetPrefix()) { optionals.set(5); } if (struct.isSetNexthop()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.isSetType()) { oprot.writeI32(struct.type); } if (struct.isSetReserved()) { oprot.writeI32(struct.reserved); } if (struct.isSetPrefixlen()) { oprot.writeI32(struct.prefixlen); } if (struct.isSetLabel()) { oprot.writeI32(struct.label); } if (struct.isSetRd()) { oprot.writeString(struct.rd); } if (struct.isSetPrefix()) { oprot.writeString(struct.prefix); } if (struct.isSetNexthop()) { oprot.writeString(struct.nexthop); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Update struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.type = iprot.readI32(); struct.setTypeIsSet(true); } if (incoming.get(1)) { struct.reserved = iprot.readI32(); struct.setReservedIsSet(true); } if (incoming.get(2)) { struct.prefixlen = iprot.readI32(); struct.setPrefixlenIsSet(true); } if (incoming.get(3)) { struct.label = iprot.readI32(); struct.setLabelIsSet(true); } if (incoming.get(4)) { struct.rd = iprot.readString(); struct.setRdIsSet(true); } if (incoming.get(5)) { struct.prefix = iprot.readString(); struct.setPrefixIsSet(true); } if (incoming.get(6)) { struct.nexthop = iprot.readString(); struct.setNexthopIsSet(true); } } } }