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.quarantine.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; /** * This struct encapsulates a piece of data that has been sent to quarantine. The associated metadata * is used to reingest the data if possible, as well as provide some context around what happened to * cause the data to be quarantined. */ public class QuarantinedObject implements org.apache.thrift.TBase<QuarantinedObject, QuarantinedObject._Fields>, java.io.Serializable, Cloneable, Comparable<QuarantinedObject> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "QuarantinedObject"); private static final org.apache.thrift.protocol.TField PIPELINE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField( "pipelineId", org.apache.thrift.protocol.TType.STRING, (short) 1); private static final org.apache.thrift.protocol.TField PIPE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField( "pipeId", org.apache.thrift.protocol.TType.STRING, (short) 2); private static final org.apache.thrift.protocol.TField CONTENT_FIELD_DESC = new org.apache.thrift.protocol.TField( "content", org.apache.thrift.protocol.TType.STRING, (short) 3); private static final org.apache.thrift.protocol.TField SERIALIZABLE_FIELD_DESC = new org.apache.thrift.protocol.TField( "serializable", org.apache.thrift.protocol.TType.BOOL, (short) 4); private static final org.apache.thrift.protocol.TField VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField( "visibility", org.apache.thrift.protocol.TType.STRUCT, (short) 5); private static final org.apache.thrift.protocol.TField APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField( "applicationName", org.apache.thrift.protocol.TType.STRING, (short) 7); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new QuarantinedObjectStandardSchemeFactory()); schemes.put(TupleScheme.class, new QuarantinedObjectTupleSchemeFactory()); } /** * The pipeline from which the quarantined object was sent. */ public String pipelineId; // optional /** * The pipe from which the quarantined object was sent. */ public String pipeId; // optional /** * The serialized object, or raw content, that is being quarantined. */ public ByteBuffer content; // optional /** * Represents if the object being quarantined is serializable. If so, the Quarantine system will attempt * to reingest the object back through its originating pipeline. */ public boolean serializable; // optional /** * The visibility associated with the provided quarantined object. */ public ezbake.base.thrift.Visibility visibility; // required /** * The application name of the process from which the quarantined object was sent. */ public String applicationName; // 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 { /** * The pipeline from which the quarantined object was sent. */ PIPELINE_ID((short) 1, "pipelineId"), /** * The pipe from which the quarantined object was sent. */ PIPE_ID((short) 2, "pipeId"), /** * The serialized object, or raw content, that is being quarantined. */ CONTENT((short) 3, "content"), /** * Represents if the object being quarantined is serializable. If so, the Quarantine system will attempt * to reingest the object back through its originating pipeline. */ SERIALIZABLE((short) 4, "serializable"), /** * The visibility associated with the provided quarantined object. */ VISIBILITY((short) 5, "visibility"), /** * The application name of the process from which the quarantined object was sent. */ APPLICATION_NAME((short) 7, "applicationName"); 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: // PIPELINE_ID return PIPELINE_ID; case 2: // PIPE_ID return PIPE_ID; case 3: // CONTENT return CONTENT; case 4: // SERIALIZABLE return SERIALIZABLE; case 5: // VISIBILITY return VISIBILITY; case 7: // APPLICATION_NAME return APPLICATION_NAME; 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 __SERIALIZABLE_ISSET_ID = 0; private byte __isset_bitfield = 0; private _Fields optionals[] = { _Fields.PIPELINE_ID, _Fields.PIPE_ID, _Fields.CONTENT, _Fields.SERIALIZABLE, _Fields.APPLICATION_NAME }; 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.PIPELINE_ID, new org.apache.thrift.meta_data.FieldMetaData("pipelineId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PIPE_ID, new org.apache.thrift.meta_data.FieldMetaData("pipeId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CONTENT, new org.apache.thrift.meta_data.FieldMetaData("content", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING, true))); tmpMap.put(_Fields.SERIALIZABLE, new org.apache.thrift.meta_data.FieldMetaData("serializable", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.VISIBILITY, new org.apache.thrift.meta_data.FieldMetaData("visibility", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ezbake.base.thrift.Visibility.class))); tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QuarantinedObject.class, metaDataMap); } public QuarantinedObject() { this.serializable = true; } public QuarantinedObject(ezbake.base.thrift.Visibility visibility) { this(); this.visibility = visibility; } /** * Performs a deep copy on <i>other</i>. */ public QuarantinedObject(QuarantinedObject other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPipelineId()) { this.pipelineId = other.pipelineId; } if (other.isSetPipeId()) { this.pipeId = other.pipeId; } if (other.isSetContent()) { this.content = org.apache.thrift.TBaseHelper.copyBinary(other.content); ; } this.serializable = other.serializable; if (other.isSetVisibility()) { this.visibility = new ezbake.base.thrift.Visibility(other.visibility); } if (other.isSetApplicationName()) { this.applicationName = other.applicationName; } } public QuarantinedObject deepCopy() { return new QuarantinedObject(this); } @Override public void clear() { this.pipelineId = null; this.pipeId = null; this.content = null; this.serializable = true; this.visibility = null; this.applicationName = null; } /** * The pipeline from which the quarantined object was sent. */ public String getPipelineId() { return this.pipelineId; } /** * The pipeline from which the quarantined object was sent. */ public QuarantinedObject setPipelineId(String pipelineId) { this.pipelineId = pipelineId; return this; } public void unsetPipelineId() { this.pipelineId = null; } /** Returns true if field pipelineId is set (has been assigned a value) and false otherwise */ public boolean isSetPipelineId() { return this.pipelineId != null; } public void setPipelineIdIsSet(boolean value) { if (!value) { this.pipelineId = null; } } /** * The pipe from which the quarantined object was sent. */ public String getPipeId() { return this.pipeId; } /** * The pipe from which the quarantined object was sent. */ public QuarantinedObject setPipeId(String pipeId) { this.pipeId = pipeId; return this; } public void unsetPipeId() { this.pipeId = null; } /** Returns true if field pipeId is set (has been assigned a value) and false otherwise */ public boolean isSetPipeId() { return this.pipeId != null; } public void setPipeIdIsSet(boolean value) { if (!value) { this.pipeId = null; } } /** * The serialized object, or raw content, that is being quarantined. */ public byte[] getContent() { setContent(org.apache.thrift.TBaseHelper.rightSize(content)); return content == null ? null : content.array(); } public ByteBuffer bufferForContent() { return content; } /** * The serialized object, or raw content, that is being quarantined. */ public QuarantinedObject setContent(byte[] content) { setContent(content == null ? (ByteBuffer) null : ByteBuffer.wrap(content)); return this; } public QuarantinedObject setContent(ByteBuffer content) { this.content = content; return this; } public void unsetContent() { this.content = null; } /** Returns true if field content is set (has been assigned a value) and false otherwise */ public boolean isSetContent() { return this.content != null; } public void setContentIsSet(boolean value) { if (!value) { this.content = null; } } /** * Represents if the object being quarantined is serializable. If so, the Quarantine system will attempt * to reingest the object back through its originating pipeline. */ public boolean isSerializable() { return this.serializable; } /** * Represents if the object being quarantined is serializable. If so, the Quarantine system will attempt * to reingest the object back through its originating pipeline. */ public QuarantinedObject setSerializable(boolean serializable) { this.serializable = serializable; setSerializableIsSet(true); return this; } public void unsetSerializable() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERIALIZABLE_ISSET_ID); } /** Returns true if field serializable is set (has been assigned a value) and false otherwise */ public boolean isSetSerializable() { return EncodingUtils.testBit(__isset_bitfield, __SERIALIZABLE_ISSET_ID); } public void setSerializableIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SERIALIZABLE_ISSET_ID, value); } /** * The visibility associated with the provided quarantined object. */ public ezbake.base.thrift.Visibility getVisibility() { return this.visibility; } /** * The visibility associated with the provided quarantined object. */ public QuarantinedObject setVisibility(ezbake.base.thrift.Visibility visibility) { this.visibility = visibility; return this; } public void unsetVisibility() { this.visibility = null; } /** Returns true if field visibility is set (has been assigned a value) and false otherwise */ public boolean isSetVisibility() { return this.visibility != null; } public void setVisibilityIsSet(boolean value) { if (!value) { this.visibility = null; } } /** * The application name of the process from which the quarantined object was sent. */ public String getApplicationName() { return this.applicationName; } /** * The application name of the process from which the quarantined object was sent. */ public QuarantinedObject setApplicationName(String applicationName) { this.applicationName = applicationName; return this; } public void unsetApplicationName() { this.applicationName = null; } /** Returns true if field applicationName is set (has been assigned a value) and false otherwise */ public boolean isSetApplicationName() { return this.applicationName != null; } public void setApplicationNameIsSet(boolean value) { if (!value) { this.applicationName = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PIPELINE_ID: if (value == null) { unsetPipelineId(); } else { setPipelineId((String) value); } break; case PIPE_ID: if (value == null) { unsetPipeId(); } else { setPipeId((String) value); } break; case CONTENT: if (value == null) { unsetContent(); } else { setContent((ByteBuffer) value); } break; case SERIALIZABLE: if (value == null) { unsetSerializable(); } else { setSerializable((Boolean) value); } break; case VISIBILITY: if (value == null) { unsetVisibility(); } else { setVisibility((ezbake.base.thrift.Visibility) value); } break; case APPLICATION_NAME: if (value == null) { unsetApplicationName(); } else { setApplicationName((String) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PIPELINE_ID: return getPipelineId(); case PIPE_ID: return getPipeId(); case CONTENT: return getContent(); case SERIALIZABLE: return Boolean.valueOf(isSerializable()); case VISIBILITY: return getVisibility(); case APPLICATION_NAME: return getApplicationName(); } 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 PIPELINE_ID: return isSetPipelineId(); case PIPE_ID: return isSetPipeId(); case CONTENT: return isSetContent(); case SERIALIZABLE: return isSetSerializable(); case VISIBILITY: return isSetVisibility(); case APPLICATION_NAME: return isSetApplicationName(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof QuarantinedObject) return this.equals((QuarantinedObject) that); return false; } public boolean equals(QuarantinedObject that) { if (that == null) return false; boolean this_present_pipelineId = true && this.isSetPipelineId(); boolean that_present_pipelineId = true && that.isSetPipelineId(); if (this_present_pipelineId || that_present_pipelineId) { if (!(this_present_pipelineId && that_present_pipelineId)) return false; if (!this.pipelineId.equals(that.pipelineId)) return false; } boolean this_present_pipeId = true && this.isSetPipeId(); boolean that_present_pipeId = true && that.isSetPipeId(); if (this_present_pipeId || that_present_pipeId) { if (!(this_present_pipeId && that_present_pipeId)) return false; if (!this.pipeId.equals(that.pipeId)) return false; } boolean this_present_content = true && this.isSetContent(); boolean that_present_content = true && that.isSetContent(); if (this_present_content || that_present_content) { if (!(this_present_content && that_present_content)) return false; if (!this.content.equals(that.content)) return false; } boolean this_present_serializable = true && this.isSetSerializable(); boolean that_present_serializable = true && that.isSetSerializable(); if (this_present_serializable || that_present_serializable) { if (!(this_present_serializable && that_present_serializable)) return false; if (this.serializable != that.serializable) return false; } boolean this_present_visibility = true && this.isSetVisibility(); boolean that_present_visibility = true && that.isSetVisibility(); if (this_present_visibility || that_present_visibility) { if (!(this_present_visibility && that_present_visibility)) return false; if (!this.visibility.equals(that.visibility)) return false; } boolean this_present_applicationName = true && this.isSetApplicationName(); boolean that_present_applicationName = true && that.isSetApplicationName(); if (this_present_applicationName || that_present_applicationName) { if (!(this_present_applicationName && that_present_applicationName)) return false; if (!this.applicationName.equals(that.applicationName)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(QuarantinedObject other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPipelineId()).compareTo(other.isSetPipelineId()); if (lastComparison != 0) { return lastComparison; } if (isSetPipelineId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pipelineId, other.pipelineId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPipeId()).compareTo(other.isSetPipeId()); if (lastComparison != 0) { return lastComparison; } if (isSetPipeId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pipeId, other.pipeId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetContent()).compareTo(other.isSetContent()); if (lastComparison != 0) { return lastComparison; } if (isSetContent()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.content, other.content); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSerializable()).compareTo(other.isSetSerializable()); if (lastComparison != 0) { return lastComparison; } if (isSetSerializable()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serializable, other.serializable); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetVisibility()).compareTo(other.isSetVisibility()); if (lastComparison != 0) { return lastComparison; } if (isSetVisibility()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.visibility, other.visibility); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); if (lastComparison != 0) { return lastComparison; } if (isSetApplicationName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName); 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("QuarantinedObject("); boolean first = true; if (isSetPipelineId()) { sb.append("pipelineId:"); if (this.pipelineId == null) { sb.append("null"); } else { sb.append(this.pipelineId); } first = false; } if (isSetPipeId()) { if (!first) sb.append(", "); sb.append("pipeId:"); if (this.pipeId == null) { sb.append("null"); } else { sb.append(this.pipeId); } first = false; } if (isSetContent()) { if (!first) sb.append(", "); sb.append("content:"); if (this.content == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.content, sb); } first = false; } if (isSetSerializable()) { if (!first) sb.append(", "); sb.append("serializable:"); sb.append(this.serializable); first = false; } if (!first) sb.append(", "); sb.append("visibility:"); if (this.visibility == null) { sb.append("null"); } else { sb.append(this.visibility); } first = false; if (isSetApplicationName()) { if (!first) sb.append(", "); sb.append("applicationName:"); if (this.applicationName == null) { sb.append("null"); } else { sb.append(this.applicationName); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (visibility == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'visibility' was not present! Struct: " + toString()); } // check for sub-struct validity if (visibility != null) { visibility.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 QuarantinedObjectStandardSchemeFactory implements SchemeFactory { public QuarantinedObjectStandardScheme getScheme() { return new QuarantinedObjectStandardScheme(); } } private static class QuarantinedObjectStandardScheme extends StandardScheme<QuarantinedObject> { public void read(org.apache.thrift.protocol.TProtocol iprot, QuarantinedObject 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: // PIPELINE_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.pipelineId = iprot.readString(); struct.setPipelineIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PIPE_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.pipeId = iprot.readString(); struct.setPipeIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // CONTENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.content = iprot.readBinary(); struct.setContentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // SERIALIZABLE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.serializable = iprot.readBool(); struct.setSerializableIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // VISIBILITY if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.visibility = new ezbake.base.thrift.Visibility(); struct.visibility.read(iprot); struct.setVisibilityIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // APPLICATION_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.applicationName = iprot.readString(); struct.setApplicationNameIsSet(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, QuarantinedObject struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.pipelineId != null) { if (struct.isSetPipelineId()) { oprot.writeFieldBegin(PIPELINE_ID_FIELD_DESC); oprot.writeString(struct.pipelineId); oprot.writeFieldEnd(); } } if (struct.pipeId != null) { if (struct.isSetPipeId()) { oprot.writeFieldBegin(PIPE_ID_FIELD_DESC); oprot.writeString(struct.pipeId); oprot.writeFieldEnd(); } } if (struct.content != null) { if (struct.isSetContent()) { oprot.writeFieldBegin(CONTENT_FIELD_DESC); oprot.writeBinary(struct.content); oprot.writeFieldEnd(); } } if (struct.isSetSerializable()) { oprot.writeFieldBegin(SERIALIZABLE_FIELD_DESC); oprot.writeBool(struct.serializable); oprot.writeFieldEnd(); } if (struct.visibility != null) { oprot.writeFieldBegin(VISIBILITY_FIELD_DESC); struct.visibility.write(oprot); oprot.writeFieldEnd(); } if (struct.applicationName != null) { if (struct.isSetApplicationName()) { oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC); oprot.writeString(struct.applicationName); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class QuarantinedObjectTupleSchemeFactory implements SchemeFactory { public QuarantinedObjectTupleScheme getScheme() { return new QuarantinedObjectTupleScheme(); } } private static class QuarantinedObjectTupleScheme extends TupleScheme<QuarantinedObject> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, QuarantinedObject struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.visibility.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPipelineId()) { optionals.set(0); } if (struct.isSetPipeId()) { optionals.set(1); } if (struct.isSetContent()) { optionals.set(2); } if (struct.isSetSerializable()) { optionals.set(3); } if (struct.isSetApplicationName()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetPipelineId()) { oprot.writeString(struct.pipelineId); } if (struct.isSetPipeId()) { oprot.writeString(struct.pipeId); } if (struct.isSetContent()) { oprot.writeBinary(struct.content); } if (struct.isSetSerializable()) { oprot.writeBool(struct.serializable); } if (struct.isSetApplicationName()) { oprot.writeString(struct.applicationName); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, QuarantinedObject struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.visibility = new ezbake.base.thrift.Visibility(); struct.visibility.read(iprot); struct.setVisibilityIsSet(true); BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.pipelineId = iprot.readString(); struct.setPipelineIdIsSet(true); } if (incoming.get(1)) { struct.pipeId = iprot.readString(); struct.setPipeIdIsSet(true); } if (incoming.get(2)) { struct.content = iprot.readBinary(); struct.setContentIsSet(true); } if (incoming.get(3)) { struct.serializable = iprot.readBool(); struct.setSerializableIsSet(true); } if (incoming.get(4)) { struct.applicationName = iprot.readString(); struct.setApplicationNameIsSet(true); } } } }