Java tutorial
/* Copyright (C) 2013-2014 Computer Sciences Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ezbake.base.thrift; 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 AdvancedMarkings implements org.apache.thrift.TBase<AdvancedMarkings, AdvancedMarkings._Fields>, java.io.Serializable, Cloneable, Comparable<AdvancedMarkings> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "AdvancedMarkings"); private static final org.apache.thrift.protocol.TField EXTERNAL_COMMUNITY_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField( "externalCommunityVisibility", org.apache.thrift.protocol.TType.STRING, (short) 1); private static final org.apache.thrift.protocol.TField PLATFORM_OBJECT_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField( "platformObjectVisibility", org.apache.thrift.protocol.TType.STRUCT, (short) 2); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField( "id", org.apache.thrift.protocol.TType.I64, (short) 3); private static final org.apache.thrift.protocol.TField COMPOSITE_FIELD_DESC = new org.apache.thrift.protocol.TField( "composite", org.apache.thrift.protocol.TType.BOOL, (short) 4); private static final org.apache.thrift.protocol.TField PURGE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField( "purgeIds", org.apache.thrift.protocol.TType.SET, (short) 5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new AdvancedMarkingsStandardSchemeFactory()); schemes.put(TupleScheme.class, new AdvancedMarkingsTupleSchemeFactory()); } public String externalCommunityVisibility; // optional public PlatformObjectVisibilities platformObjectVisibility; // optional public long id; // optional public boolean composite; // optional public Set<Long> purgeIds; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { EXTERNAL_COMMUNITY_VISIBILITY((short) 1, "externalCommunityVisibility"), PLATFORM_OBJECT_VISIBILITY( (short) 2, "platformObjectVisibility"), ID((short) 3, "id"), COMPOSITE((short) 4, "composite"), PURGE_IDS((short) 5, "purgeIds"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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: // EXTERNAL_COMMUNITY_VISIBILITY return EXTERNAL_COMMUNITY_VISIBILITY; case 2: // PLATFORM_OBJECT_VISIBILITY return PLATFORM_OBJECT_VISIBILITY; case 3: // ID return ID; case 4: // COMPOSITE return COMPOSITE; case 5: // PURGE_IDS return PURGE_IDS; 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 __ID_ISSET_ID = 0; private static final int __COMPOSITE_ISSET_ID = 1; private byte __isset_bitfield = 0; private _Fields optionals[] = { _Fields.EXTERNAL_COMMUNITY_VISIBILITY, _Fields.PLATFORM_OBJECT_VISIBILITY, _Fields.ID, _Fields.COMPOSITE, _Fields.PURGE_IDS }; 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.EXTERNAL_COMMUNITY_VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData( "externalCommunityVisibility", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PLATFORM_OBJECT_VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData("platformObjectVisibility", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PlatformObjectVisibilities.class))); tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.COMPOSITE, new org.apache.thrift.meta_data.FieldMetaData("composite", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PURGE_IDS, new org.apache.thrift.meta_data.FieldMetaData("purgeIds", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AdvancedMarkings.class, metaDataMap); } public AdvancedMarkings() { } /** * Performs a deep copy on <i>other</i>. */ public AdvancedMarkings(AdvancedMarkings other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetExternalCommunityVisibility()) { this.externalCommunityVisibility = other.externalCommunityVisibility; } if (other.isSetPlatformObjectVisibility()) { this.platformObjectVisibility = new PlatformObjectVisibilities(other.platformObjectVisibility); } this.id = other.id; this.composite = other.composite; if (other.isSetPurgeIds()) { Set<Long> __this__purgeIds = new HashSet<Long>(other.purgeIds); this.purgeIds = __this__purgeIds; } } public AdvancedMarkings deepCopy() { return new AdvancedMarkings(this); } @Override public void clear() { this.externalCommunityVisibility = null; this.platformObjectVisibility = null; setIdIsSet(false); this.id = 0; setCompositeIsSet(false); this.composite = false; this.purgeIds = null; } public String getExternalCommunityVisibility() { return this.externalCommunityVisibility; } public AdvancedMarkings setExternalCommunityVisibility(String externalCommunityVisibility) { this.externalCommunityVisibility = externalCommunityVisibility; return this; } public void unsetExternalCommunityVisibility() { this.externalCommunityVisibility = null; } /** Returns true if field externalCommunityVisibility is set (has been assigned a value) and false otherwise */ public boolean isSetExternalCommunityVisibility() { return this.externalCommunityVisibility != null; } public void setExternalCommunityVisibilityIsSet(boolean value) { if (!value) { this.externalCommunityVisibility = null; } } public PlatformObjectVisibilities getPlatformObjectVisibility() { return this.platformObjectVisibility; } public AdvancedMarkings setPlatformObjectVisibility(PlatformObjectVisibilities platformObjectVisibility) { this.platformObjectVisibility = platformObjectVisibility; return this; } public void unsetPlatformObjectVisibility() { this.platformObjectVisibility = null; } /** Returns true if field platformObjectVisibility is set (has been assigned a value) and false otherwise */ public boolean isSetPlatformObjectVisibility() { return this.platformObjectVisibility != null; } public void setPlatformObjectVisibilityIsSet(boolean value) { if (!value) { this.platformObjectVisibility = null; } } public long getId() { return this.id; } public AdvancedMarkings setId(long id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public boolean isComposite() { return this.composite; } public AdvancedMarkings setComposite(boolean composite) { this.composite = composite; setCompositeIsSet(true); return this; } public void unsetComposite() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPOSITE_ISSET_ID); } /** Returns true if field composite is set (has been assigned a value) and false otherwise */ public boolean isSetComposite() { return EncodingUtils.testBit(__isset_bitfield, __COMPOSITE_ISSET_ID); } public void setCompositeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPOSITE_ISSET_ID, value); } public int getPurgeIdsSize() { return (this.purgeIds == null) ? 0 : this.purgeIds.size(); } public java.util.Iterator<Long> getPurgeIdsIterator() { return (this.purgeIds == null) ? null : this.purgeIds.iterator(); } public void addToPurgeIds(long elem) { if (this.purgeIds == null) { this.purgeIds = new HashSet<Long>(); } this.purgeIds.add(elem); } public Set<Long> getPurgeIds() { return this.purgeIds; } public AdvancedMarkings setPurgeIds(Set<Long> purgeIds) { this.purgeIds = purgeIds; return this; } public void unsetPurgeIds() { this.purgeIds = null; } /** Returns true if field purgeIds is set (has been assigned a value) and false otherwise */ public boolean isSetPurgeIds() { return this.purgeIds != null; } public void setPurgeIdsIsSet(boolean value) { if (!value) { this.purgeIds = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case EXTERNAL_COMMUNITY_VISIBILITY: if (value == null) { unsetExternalCommunityVisibility(); } else { setExternalCommunityVisibility((String) value); } break; case PLATFORM_OBJECT_VISIBILITY: if (value == null) { unsetPlatformObjectVisibility(); } else { setPlatformObjectVisibility((PlatformObjectVisibilities) value); } break; case ID: if (value == null) { unsetId(); } else { setId((Long) value); } break; case COMPOSITE: if (value == null) { unsetComposite(); } else { setComposite((Boolean) value); } break; case PURGE_IDS: if (value == null) { unsetPurgeIds(); } else { setPurgeIds((Set<Long>) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case EXTERNAL_COMMUNITY_VISIBILITY: return getExternalCommunityVisibility(); case PLATFORM_OBJECT_VISIBILITY: return getPlatformObjectVisibility(); case ID: return Long.valueOf(getId()); case COMPOSITE: return Boolean.valueOf(isComposite()); case PURGE_IDS: return getPurgeIds(); } 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 EXTERNAL_COMMUNITY_VISIBILITY: return isSetExternalCommunityVisibility(); case PLATFORM_OBJECT_VISIBILITY: return isSetPlatformObjectVisibility(); case ID: return isSetId(); case COMPOSITE: return isSetComposite(); case PURGE_IDS: return isSetPurgeIds(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof AdvancedMarkings) return this.equals((AdvancedMarkings) that); return false; } public boolean equals(AdvancedMarkings that) { if (that == null) return false; boolean this_present_externalCommunityVisibility = true && this.isSetExternalCommunityVisibility(); boolean that_present_externalCommunityVisibility = true && that.isSetExternalCommunityVisibility(); if (this_present_externalCommunityVisibility || that_present_externalCommunityVisibility) { if (!(this_present_externalCommunityVisibility && that_present_externalCommunityVisibility)) return false; if (!this.externalCommunityVisibility.equals(that.externalCommunityVisibility)) return false; } boolean this_present_platformObjectVisibility = true && this.isSetPlatformObjectVisibility(); boolean that_present_platformObjectVisibility = true && that.isSetPlatformObjectVisibility(); if (this_present_platformObjectVisibility || that_present_platformObjectVisibility) { if (!(this_present_platformObjectVisibility && that_present_platformObjectVisibility)) return false; if (!this.platformObjectVisibility.equals(that.platformObjectVisibility)) return false; } boolean this_present_id = true && this.isSetId(); boolean that_present_id = true && that.isSetId(); if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_composite = true && this.isSetComposite(); boolean that_present_composite = true && that.isSetComposite(); if (this_present_composite || that_present_composite) { if (!(this_present_composite && that_present_composite)) return false; if (this.composite != that.composite) return false; } boolean this_present_purgeIds = true && this.isSetPurgeIds(); boolean that_present_purgeIds = true && that.isSetPurgeIds(); if (this_present_purgeIds || that_present_purgeIds) { if (!(this_present_purgeIds && that_present_purgeIds)) return false; if (!this.purgeIds.equals(that.purgeIds)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(AdvancedMarkings other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetExternalCommunityVisibility()) .compareTo(other.isSetExternalCommunityVisibility()); if (lastComparison != 0) { return lastComparison; } if (isSetExternalCommunityVisibility()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.externalCommunityVisibility, other.externalCommunityVisibility); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPlatformObjectVisibility()) .compareTo(other.isSetPlatformObjectVisibility()); if (lastComparison != 0) { return lastComparison; } if (isSetPlatformObjectVisibility()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.platformObjectVisibility, other.platformObjectVisibility); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetComposite()).compareTo(other.isSetComposite()); if (lastComparison != 0) { return lastComparison; } if (isSetComposite()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.composite, other.composite); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPurgeIds()).compareTo(other.isSetPurgeIds()); if (lastComparison != 0) { return lastComparison; } if (isSetPurgeIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purgeIds, other.purgeIds); 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("AdvancedMarkings("); boolean first = true; if (isSetExternalCommunityVisibility()) { sb.append("externalCommunityVisibility:"); if (this.externalCommunityVisibility == null) { sb.append("null"); } else { sb.append(this.externalCommunityVisibility); } first = false; } if (isSetPlatformObjectVisibility()) { if (!first) sb.append(", "); sb.append("platformObjectVisibility:"); if (this.platformObjectVisibility == null) { sb.append("null"); } else { sb.append(this.platformObjectVisibility); } first = false; } if (isSetId()) { if (!first) sb.append(", "); sb.append("id:"); sb.append(this.id); first = false; } if (isSetComposite()) { if (!first) sb.append(", "); sb.append("composite:"); sb.append(this.composite); first = false; } if (isSetPurgeIds()) { if (!first) sb.append(", "); sb.append("purgeIds:"); if (this.purgeIds == null) { sb.append("null"); } else { sb.append(this.purgeIds); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (platformObjectVisibility != null) { platformObjectVisibility.validate(); } } 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 AdvancedMarkingsStandardSchemeFactory implements SchemeFactory { public AdvancedMarkingsStandardScheme getScheme() { return new AdvancedMarkingsStandardScheme(); } } private static class AdvancedMarkingsStandardScheme extends StandardScheme<AdvancedMarkings> { public void read(org.apache.thrift.protocol.TProtocol iprot, AdvancedMarkings 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: // EXTERNAL_COMMUNITY_VISIBILITY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.externalCommunityVisibility = iprot.readString(); struct.setExternalCommunityVisibilityIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PLATFORM_OBJECT_VISIBILITY if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.platformObjectVisibility = new PlatformObjectVisibilities(); struct.platformObjectVisibility.read(iprot); struct.setPlatformObjectVisibilityIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // COMPOSITE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.composite = iprot.readBool(); struct.setCompositeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PURGE_IDS if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set32 = iprot.readSetBegin(); struct.purgeIds = new HashSet<Long>(2 * _set32.size); for (int _i33 = 0; _i33 < _set32.size; ++_i33) { long _elem34; _elem34 = iprot.readI64(); struct.purgeIds.add(_elem34); } iprot.readSetEnd(); } struct.setPurgeIdsIsSet(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, AdvancedMarkings struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.externalCommunityVisibility != null) { if (struct.isSetExternalCommunityVisibility()) { oprot.writeFieldBegin(EXTERNAL_COMMUNITY_VISIBILITY_FIELD_DESC); oprot.writeString(struct.externalCommunityVisibility); oprot.writeFieldEnd(); } } if (struct.platformObjectVisibility != null) { if (struct.isSetPlatformObjectVisibility()) { oprot.writeFieldBegin(PLATFORM_OBJECT_VISIBILITY_FIELD_DESC); struct.platformObjectVisibility.write(oprot); oprot.writeFieldEnd(); } } if (struct.isSetId()) { oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI64(struct.id); oprot.writeFieldEnd(); } if (struct.isSetComposite()) { oprot.writeFieldBegin(COMPOSITE_FIELD_DESC); oprot.writeBool(struct.composite); oprot.writeFieldEnd(); } if (struct.purgeIds != null) { if (struct.isSetPurgeIds()) { oprot.writeFieldBegin(PURGE_IDS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.I64, struct.purgeIds.size())); for (long _iter35 : struct.purgeIds) { oprot.writeI64(_iter35); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class AdvancedMarkingsTupleSchemeFactory implements SchemeFactory { public AdvancedMarkingsTupleScheme getScheme() { return new AdvancedMarkingsTupleScheme(); } } private static class AdvancedMarkingsTupleScheme extends TupleScheme<AdvancedMarkings> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, AdvancedMarkings struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetExternalCommunityVisibility()) { optionals.set(0); } if (struct.isSetPlatformObjectVisibility()) { optionals.set(1); } if (struct.isSetId()) { optionals.set(2); } if (struct.isSetComposite()) { optionals.set(3); } if (struct.isSetPurgeIds()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetExternalCommunityVisibility()) { oprot.writeString(struct.externalCommunityVisibility); } if (struct.isSetPlatformObjectVisibility()) { struct.platformObjectVisibility.write(oprot); } if (struct.isSetId()) { oprot.writeI64(struct.id); } if (struct.isSetComposite()) { oprot.writeBool(struct.composite); } if (struct.isSetPurgeIds()) { { oprot.writeI32(struct.purgeIds.size()); for (long _iter36 : struct.purgeIds) { oprot.writeI64(_iter36); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, AdvancedMarkings struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.externalCommunityVisibility = iprot.readString(); struct.setExternalCommunityVisibilityIsSet(true); } if (incoming.get(1)) { struct.platformObjectVisibility = new PlatformObjectVisibilities(); struct.platformObjectVisibility.read(iprot); struct.setPlatformObjectVisibilityIsSet(true); } if (incoming.get(2)) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } if (incoming.get(3)) { struct.composite = iprot.readBool(); struct.setCompositeIsSet(true); } if (incoming.get(4)) { { org.apache.thrift.protocol.TSet _set37 = new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.purgeIds = new HashSet<Long>(2 * _set37.size); for (int _i38 = 0; _i38 < _set37.size; ++_i38) { long _elem39; _elem39 = iprot.readI64(); struct.purgeIds.add(_elem39); } } struct.setPurgeIdsIsSet(true); } } } }