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.services.deploy.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 ArtifactInfo implements org.apache.thrift.TBase<ArtifactInfo, ArtifactInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ArtifactInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "ArtifactInfo"); private static final org.apache.thrift.protocol.TField RESOURCE_REQUIREMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField( "resourceRequirements", org.apache.thrift.protocol.TType.STRUCT, (short) 1); private static final org.apache.thrift.protocol.TField LANGUAGE_FIELD_DESC = new org.apache.thrift.protocol.TField( "language", org.apache.thrift.protocol.TType.I32, (short) 2); private static final org.apache.thrift.protocol.TField BIN_FIELD_DESC = new org.apache.thrift.protocol.TField( "bin", org.apache.thrift.protocol.TType.STRING, (short) 3); private static final org.apache.thrift.protocol.TField CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField( "config", org.apache.thrift.protocol.TType.SET, (short) 4); private static final org.apache.thrift.protocol.TField PURGEABLE_FIELD_DESC = new org.apache.thrift.protocol.TField( "purgeable", org.apache.thrift.protocol.TType.BOOL, (short) 5); private static final org.apache.thrift.protocol.TField SYSTEM_LOGFILE_DISABLED_FIELD_DESC = new org.apache.thrift.protocol.TField( "systemLogfileDisabled", org.apache.thrift.protocol.TType.BOOL, (short) 6); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new ArtifactInfoStandardSchemeFactory()); schemes.put(TupleScheme.class, new ArtifactInfoTupleSchemeFactory()); } public ResourceRequirements resourceRequirements; // optional /** * * @see Language */ public Language language; // optional public String bin; // optional public Set<String> config; // optional public boolean purgeable; // optional public boolean systemLogfileDisabled; // 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 { RESOURCE_REQUIREMENTS((short) 1, "resourceRequirements"), /** * * @see Language */ LANGUAGE((short) 2, "language"), BIN((short) 3, "bin"), CONFIG((short) 4, "config"), PURGEABLE((short) 5, "purgeable"), SYSTEM_LOGFILE_DISABLED((short) 6, "systemLogfileDisabled"); 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: // RESOURCE_REQUIREMENTS return RESOURCE_REQUIREMENTS; case 2: // LANGUAGE return LANGUAGE; case 3: // BIN return BIN; case 4: // CONFIG return CONFIG; case 5: // PURGEABLE return PURGEABLE; case 6: // SYSTEM_LOGFILE_DISABLED return SYSTEM_LOGFILE_DISABLED; 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 __PURGEABLE_ISSET_ID = 0; private static final int __SYSTEMLOGFILEDISABLED_ISSET_ID = 1; private byte __isset_bitfield = 0; private _Fields optionals[] = { _Fields.RESOURCE_REQUIREMENTS, _Fields.LANGUAGE, _Fields.BIN, _Fields.CONFIG, _Fields.PURGEABLE, _Fields.SYSTEM_LOGFILE_DISABLED }; 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.RESOURCE_REQUIREMENTS, new org.apache.thrift.meta_data.FieldMetaData("resourceRequirements", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ResourceRequirements.class))); tmpMap.put(_Fields.LANGUAGE, new org.apache.thrift.meta_data.FieldMetaData("language", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Language.class))); tmpMap.put(_Fields.BIN, new org.apache.thrift.meta_data.FieldMetaData("bin", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CONFIG, new org.apache.thrift.meta_data.FieldMetaData("config", 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.STRING)))); tmpMap.put(_Fields.PURGEABLE, new org.apache.thrift.meta_data.FieldMetaData("purgeable", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SYSTEM_LOGFILE_DISABLED, new org.apache.thrift.meta_data.FieldMetaData("systemLogfileDisabled", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ArtifactInfo.class, metaDataMap); } public ArtifactInfo() { this.resourceRequirements = new ResourceRequirements(); this.language = ezbake.services.deploy.thrift.Language.Java; this.purgeable = false; } /** * Performs a deep copy on <i>other</i>. */ public ArtifactInfo(ArtifactInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetResourceRequirements()) { this.resourceRequirements = new ResourceRequirements(other.resourceRequirements); } if (other.isSetLanguage()) { this.language = other.language; } if (other.isSetBin()) { this.bin = other.bin; } if (other.isSetConfig()) { Set<String> __this__config = new HashSet<String>(other.config); this.config = __this__config; } this.purgeable = other.purgeable; this.systemLogfileDisabled = other.systemLogfileDisabled; } public ArtifactInfo deepCopy() { return new ArtifactInfo(this); } @Override public void clear() { this.resourceRequirements = new ResourceRequirements(); this.language = ezbake.services.deploy.thrift.Language.Java; this.bin = null; this.config = null; this.purgeable = false; setSystemLogfileDisabledIsSet(false); this.systemLogfileDisabled = false; } public ResourceRequirements getResourceRequirements() { return this.resourceRequirements; } public ArtifactInfo setResourceRequirements(ResourceRequirements resourceRequirements) { this.resourceRequirements = resourceRequirements; return this; } public void unsetResourceRequirements() { this.resourceRequirements = null; } /** Returns true if field resourceRequirements is set (has been assigned a value) and false otherwise */ public boolean isSetResourceRequirements() { return this.resourceRequirements != null; } public void setResourceRequirementsIsSet(boolean value) { if (!value) { this.resourceRequirements = null; } } /** * * @see Language */ public Language getLanguage() { return this.language; } /** * * @see Language */ public ArtifactInfo setLanguage(Language language) { this.language = language; return this; } public void unsetLanguage() { this.language = null; } /** Returns true if field language is set (has been assigned a value) and false otherwise */ public boolean isSetLanguage() { return this.language != null; } public void setLanguageIsSet(boolean value) { if (!value) { this.language = null; } } public String getBin() { return this.bin; } public ArtifactInfo setBin(String bin) { this.bin = bin; return this; } public void unsetBin() { this.bin = null; } /** Returns true if field bin is set (has been assigned a value) and false otherwise */ public boolean isSetBin() { return this.bin != null; } public void setBinIsSet(boolean value) { if (!value) { this.bin = null; } } public int getConfigSize() { return (this.config == null) ? 0 : this.config.size(); } public java.util.Iterator<String> getConfigIterator() { return (this.config == null) ? null : this.config.iterator(); } public void addToConfig(String elem) { if (this.config == null) { this.config = new HashSet<String>(); } this.config.add(elem); } public Set<String> getConfig() { return this.config; } public ArtifactInfo setConfig(Set<String> config) { this.config = config; return this; } public void unsetConfig() { this.config = null; } /** Returns true if field config is set (has been assigned a value) and false otherwise */ public boolean isSetConfig() { return this.config != null; } public void setConfigIsSet(boolean value) { if (!value) { this.config = null; } } public boolean isPurgeable() { return this.purgeable; } public ArtifactInfo setPurgeable(boolean purgeable) { this.purgeable = purgeable; setPurgeableIsSet(true); return this; } public void unsetPurgeable() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PURGEABLE_ISSET_ID); } /** Returns true if field purgeable is set (has been assigned a value) and false otherwise */ public boolean isSetPurgeable() { return EncodingUtils.testBit(__isset_bitfield, __PURGEABLE_ISSET_ID); } public void setPurgeableIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PURGEABLE_ISSET_ID, value); } public boolean isSystemLogfileDisabled() { return this.systemLogfileDisabled; } public ArtifactInfo setSystemLogfileDisabled(boolean systemLogfileDisabled) { this.systemLogfileDisabled = systemLogfileDisabled; setSystemLogfileDisabledIsSet(true); return this; } public void unsetSystemLogfileDisabled() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SYSTEMLOGFILEDISABLED_ISSET_ID); } /** Returns true if field systemLogfileDisabled is set (has been assigned a value) and false otherwise */ public boolean isSetSystemLogfileDisabled() { return EncodingUtils.testBit(__isset_bitfield, __SYSTEMLOGFILEDISABLED_ISSET_ID); } public void setSystemLogfileDisabledIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SYSTEMLOGFILEDISABLED_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_REQUIREMENTS: if (value == null) { unsetResourceRequirements(); } else { setResourceRequirements((ResourceRequirements) value); } break; case LANGUAGE: if (value == null) { unsetLanguage(); } else { setLanguage((Language) value); } break; case BIN: if (value == null) { unsetBin(); } else { setBin((String) value); } break; case CONFIG: if (value == null) { unsetConfig(); } else { setConfig((Set<String>) value); } break; case PURGEABLE: if (value == null) { unsetPurgeable(); } else { setPurgeable((Boolean) value); } break; case SYSTEM_LOGFILE_DISABLED: if (value == null) { unsetSystemLogfileDisabled(); } else { setSystemLogfileDisabled((Boolean) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case RESOURCE_REQUIREMENTS: return getResourceRequirements(); case LANGUAGE: return getLanguage(); case BIN: return getBin(); case CONFIG: return getConfig(); case PURGEABLE: return Boolean.valueOf(isPurgeable()); case SYSTEM_LOGFILE_DISABLED: return Boolean.valueOf(isSystemLogfileDisabled()); } 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 RESOURCE_REQUIREMENTS: return isSetResourceRequirements(); case LANGUAGE: return isSetLanguage(); case BIN: return isSetBin(); case CONFIG: return isSetConfig(); case PURGEABLE: return isSetPurgeable(); case SYSTEM_LOGFILE_DISABLED: return isSetSystemLogfileDisabled(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ArtifactInfo) return this.equals((ArtifactInfo) that); return false; } public boolean equals(ArtifactInfo that) { if (that == null) return false; boolean this_present_resourceRequirements = true && this.isSetResourceRequirements(); boolean that_present_resourceRequirements = true && that.isSetResourceRequirements(); if (this_present_resourceRequirements || that_present_resourceRequirements) { if (!(this_present_resourceRequirements && that_present_resourceRequirements)) return false; if (!this.resourceRequirements.equals(that.resourceRequirements)) return false; } boolean this_present_language = true && this.isSetLanguage(); boolean that_present_language = true && that.isSetLanguage(); if (this_present_language || that_present_language) { if (!(this_present_language && that_present_language)) return false; if (!this.language.equals(that.language)) return false; } boolean this_present_bin = true && this.isSetBin(); boolean that_present_bin = true && that.isSetBin(); if (this_present_bin || that_present_bin) { if (!(this_present_bin && that_present_bin)) return false; if (!this.bin.equals(that.bin)) return false; } boolean this_present_config = true && this.isSetConfig(); boolean that_present_config = true && that.isSetConfig(); if (this_present_config || that_present_config) { if (!(this_present_config && that_present_config)) return false; if (!this.config.equals(that.config)) return false; } boolean this_present_purgeable = true && this.isSetPurgeable(); boolean that_present_purgeable = true && that.isSetPurgeable(); if (this_present_purgeable || that_present_purgeable) { if (!(this_present_purgeable && that_present_purgeable)) return false; if (this.purgeable != that.purgeable) return false; } boolean this_present_systemLogfileDisabled = true && this.isSetSystemLogfileDisabled(); boolean that_present_systemLogfileDisabled = true && that.isSetSystemLogfileDisabled(); if (this_present_systemLogfileDisabled || that_present_systemLogfileDisabled) { if (!(this_present_systemLogfileDisabled && that_present_systemLogfileDisabled)) return false; if (this.systemLogfileDisabled != that.systemLogfileDisabled) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(ArtifactInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetResourceRequirements()).compareTo(other.isSetResourceRequirements()); if (lastComparison != 0) { return lastComparison; } if (isSetResourceRequirements()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceRequirements, other.resourceRequirements); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLanguage()).compareTo(other.isSetLanguage()); if (lastComparison != 0) { return lastComparison; } if (isSetLanguage()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.language, other.language); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBin()).compareTo(other.isSetBin()); if (lastComparison != 0) { return lastComparison; } if (isSetBin()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bin, other.bin); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetConfig()).compareTo(other.isSetConfig()); if (lastComparison != 0) { return lastComparison; } if (isSetConfig()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.config, other.config); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPurgeable()).compareTo(other.isSetPurgeable()); if (lastComparison != 0) { return lastComparison; } if (isSetPurgeable()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purgeable, other.purgeable); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSystemLogfileDisabled()) .compareTo(other.isSetSystemLogfileDisabled()); if (lastComparison != 0) { return lastComparison; } if (isSetSystemLogfileDisabled()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.systemLogfileDisabled, other.systemLogfileDisabled); 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("ArtifactInfo("); boolean first = true; if (isSetResourceRequirements()) { sb.append("resourceRequirements:"); if (this.resourceRequirements == null) { sb.append("null"); } else { sb.append(this.resourceRequirements); } first = false; } if (isSetLanguage()) { if (!first) sb.append(", "); sb.append("language:"); if (this.language == null) { sb.append("null"); } else { sb.append(this.language); } first = false; } if (isSetBin()) { if (!first) sb.append(", "); sb.append("bin:"); if (this.bin == null) { sb.append("null"); } else { sb.append(this.bin); } first = false; } if (isSetConfig()) { if (!first) sb.append(", "); sb.append("config:"); if (this.config == null) { sb.append("null"); } else { sb.append(this.config); } first = false; } if (isSetPurgeable()) { if (!first) sb.append(", "); sb.append("purgeable:"); sb.append(this.purgeable); first = false; } if (isSetSystemLogfileDisabled()) { if (!first) sb.append(", "); sb.append("systemLogfileDisabled:"); sb.append(this.systemLogfileDisabled); 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 (resourceRequirements != null) { resourceRequirements.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 ArtifactInfoStandardSchemeFactory implements SchemeFactory { public ArtifactInfoStandardScheme getScheme() { return new ArtifactInfoStandardScheme(); } } private static class ArtifactInfoStandardScheme extends StandardScheme<ArtifactInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, ArtifactInfo 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: // RESOURCE_REQUIREMENTS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.resourceRequirements = new ResourceRequirements(); struct.resourceRequirements.read(iprot); struct.setResourceRequirementsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // LANGUAGE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.language = Language.findByValue(iprot.readI32()); struct.setLanguageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.bin = iprot.readString(); struct.setBinIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CONFIG if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set16 = iprot.readSetBegin(); struct.config = new HashSet<String>(2 * _set16.size); for (int _i17 = 0; _i17 < _set16.size; ++_i17) { String _elem18; _elem18 = iprot.readString(); struct.config.add(_elem18); } iprot.readSetEnd(); } struct.setConfigIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PURGEABLE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.purgeable = iprot.readBool(); struct.setPurgeableIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SYSTEM_LOGFILE_DISABLED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.systemLogfileDisabled = iprot.readBool(); struct.setSystemLogfileDisabledIsSet(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, ArtifactInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.resourceRequirements != null) { if (struct.isSetResourceRequirements()) { oprot.writeFieldBegin(RESOURCE_REQUIREMENTS_FIELD_DESC); struct.resourceRequirements.write(oprot); oprot.writeFieldEnd(); } } if (struct.language != null) { if (struct.isSetLanguage()) { oprot.writeFieldBegin(LANGUAGE_FIELD_DESC); oprot.writeI32(struct.language.getValue()); oprot.writeFieldEnd(); } } if (struct.bin != null) { if (struct.isSetBin()) { oprot.writeFieldBegin(BIN_FIELD_DESC); oprot.writeString(struct.bin); oprot.writeFieldEnd(); } } if (struct.config != null) { if (struct.isSetConfig()) { oprot.writeFieldBegin(CONFIG_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.STRING, struct.config.size())); for (String _iter19 : struct.config) { oprot.writeString(_iter19); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } } if (struct.isSetPurgeable()) { oprot.writeFieldBegin(PURGEABLE_FIELD_DESC); oprot.writeBool(struct.purgeable); oprot.writeFieldEnd(); } if (struct.isSetSystemLogfileDisabled()) { oprot.writeFieldBegin(SYSTEM_LOGFILE_DISABLED_FIELD_DESC); oprot.writeBool(struct.systemLogfileDisabled); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class ArtifactInfoTupleSchemeFactory implements SchemeFactory { public ArtifactInfoTupleScheme getScheme() { return new ArtifactInfoTupleScheme(); } } private static class ArtifactInfoTupleScheme extends TupleScheme<ArtifactInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ArtifactInfo struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetResourceRequirements()) { optionals.set(0); } if (struct.isSetLanguage()) { optionals.set(1); } if (struct.isSetBin()) { optionals.set(2); } if (struct.isSetConfig()) { optionals.set(3); } if (struct.isSetPurgeable()) { optionals.set(4); } if (struct.isSetSystemLogfileDisabled()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetResourceRequirements()) { struct.resourceRequirements.write(oprot); } if (struct.isSetLanguage()) { oprot.writeI32(struct.language.getValue()); } if (struct.isSetBin()) { oprot.writeString(struct.bin); } if (struct.isSetConfig()) { { oprot.writeI32(struct.config.size()); for (String _iter20 : struct.config) { oprot.writeString(_iter20); } } } if (struct.isSetPurgeable()) { oprot.writeBool(struct.purgeable); } if (struct.isSetSystemLogfileDisabled()) { oprot.writeBool(struct.systemLogfileDisabled); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ArtifactInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.resourceRequirements = new ResourceRequirements(); struct.resourceRequirements.read(iprot); struct.setResourceRequirementsIsSet(true); } if (incoming.get(1)) { struct.language = Language.findByValue(iprot.readI32()); struct.setLanguageIsSet(true); } if (incoming.get(2)) { struct.bin = iprot.readString(); struct.setBinIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TSet _set21 = new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.config = new HashSet<String>(2 * _set21.size); for (int _i22 = 0; _i22 < _set21.size; ++_i22) { String _elem23; _elem23 = iprot.readString(); struct.config.add(_elem23); } } struct.setConfigIsSet(true); } if (incoming.get(4)) { struct.purgeable = iprot.readBool(); struct.setPurgeableIsSet(true); } if (incoming.get(5)) { struct.systemLogfileDisabled = iprot.readBool(); struct.setSystemLogfileDisabledIsSet(true); } } } }