/** * Autogenerated by Thrift Compiler (0.8.0-dev) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.pyload.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 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 FileData implements org.apache.thrift.TBase<FileData, FileData._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileData"); private static final org.apache.thrift.protocol.TField FID_FIELD_DESC = new org.apache.thrift.protocol.TField("fid", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField URL_FIELD_DESC = new org.apache.thrift.protocol.TField("url", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField PLUGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("plugin", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("size", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField FORMAT_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("format_size", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)7); private static final org.apache.thrift.protocol.TField STATUSMSG_FIELD_DESC = new org.apache.thrift.protocol.TField("statusmsg", org.apache.thrift.protocol.TType.STRING, (short)8); private static final org.apache.thrift.protocol.TField PACKAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("packageID", org.apache.thrift.protocol.TType.I32, (short)9); private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)10); private static final org.apache.thrift.protocol.TField ORDER_FIELD_DESC = new org.apache.thrift.protocol.TField("order", org.apache.thrift.protocol.TType.I16, (short)11); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new FileDataStandardSchemeFactory()); schemes.put(TupleScheme.class, new FileDataTupleSchemeFactory()); } public int fid; // required public String url; // required public String name; // required public String plugin; // required public long size; // required public String format_size; // required /** * * @see DownloadStatus */ public DownloadStatus status; // required public String statusmsg; // required public int packageID; // required public String error; // required public short order; // 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 { FID((short)1, "fid"), URL((short)2, "url"), NAME((short)3, "name"), PLUGIN((short)4, "plugin"), SIZE((short)5, "size"), FORMAT_SIZE((short)6, "format_size"), /** * * @see DownloadStatus */ STATUS((short)7, "status"), STATUSMSG((short)8, "statusmsg"), PACKAGE_ID((short)9, "packageID"), ERROR((short)10, "error"), ORDER((short)11, "order"); 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: // FID return FID; case 2: // URL return URL; case 3: // NAME return NAME; case 4: // PLUGIN return PLUGIN; case 5: // SIZE return SIZE; case 6: // FORMAT_SIZE return FORMAT_SIZE; case 7: // STATUS return STATUS; case 8: // STATUSMSG return STATUSMSG; case 9: // PACKAGE_ID return PACKAGE_ID; case 10: // ERROR return ERROR; case 11: // ORDER return ORDER; 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 __FID_ISSET_ID = 0; private static final int __SIZE_ISSET_ID = 1; private static final int __PACKAGEID_ISSET_ID = 2; private static final int __ORDER_ISSET_ID = 3; private BitSet __isset_bit_vector = new BitSet(4); 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.FID, new org.apache.thrift.meta_data.FieldMetaData("fid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "FileID"))); tmpMap.put(_Fields.URL, new org.apache.thrift.meta_data.FieldMetaData("url", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PLUGIN, new org.apache.thrift.meta_data.FieldMetaData("plugin", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "PluginName"))); tmpMap.put(_Fields.SIZE, new org.apache.thrift.meta_data.FieldMetaData("size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.FORMAT_SIZE, new org.apache.thrift.meta_data.FieldMetaData("format_size", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DownloadStatus.class))); tmpMap.put(_Fields.STATUSMSG, new org.apache.thrift.meta_data.FieldMetaData("statusmsg", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PACKAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("packageID", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "PackageID"))); tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ORDER, new org.apache.thrift.meta_data.FieldMetaData("order", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FileData.class, metaDataMap); } public FileData() { } public FileData( int fid, String url, String name, String plugin, long size, String format_size, DownloadStatus status, String statusmsg, int packageID, String error, short order) { this(); this.fid = fid; setFidIsSet(true); this.url = url; this.name = name; this.plugin = plugin; this.size = size; setSizeIsSet(true); this.format_size = format_size; this.status = status; this.statusmsg = statusmsg; this.packageID = packageID; setPackageIDIsSet(true); this.error = error; this.order = order; setOrderIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public FileData(FileData other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.fid = other.fid; if (other.isSetUrl()) { this.url = other.url; } if (other.isSetName()) { this.name = other.name; } if (other.isSetPlugin()) { this.plugin = other.plugin; } this.size = other.size; if (other.isSetFormat_size()) { this.format_size = other.format_size; } if (other.isSetStatus()) { this.status = other.status; } if (other.isSetStatusmsg()) { this.statusmsg = other.statusmsg; } this.packageID = other.packageID; if (other.isSetError()) { this.error = other.error; } this.order = other.order; } public FileData deepCopy() { return new FileData(this); } @Override public void clear() { setFidIsSet(false); this.fid = 0; this.url = null; this.name = null; this.plugin = null; setSizeIsSet(false); this.size = 0; this.format_size = null; this.status = null; this.statusmsg = null; setPackageIDIsSet(false); this.packageID = 0; this.error = null; setOrderIsSet(false); this.order = 0; } public int getFid() { return this.fid; } public FileData setFid(int fid) { this.fid = fid; setFidIsSet(true); return this; } public void unsetFid() { __isset_bit_vector.clear(__FID_ISSET_ID); } /** Returns true if field fid is set (has been assigned a value) and false otherwise */ public boolean isSetFid() { return __isset_bit_vector.get(__FID_ISSET_ID); } public void setFidIsSet(boolean value) { __isset_bit_vector.set(__FID_ISSET_ID, value); } public String getUrl() { return this.url; } public FileData setUrl(String url) { this.url = url; return this; } public void unsetUrl() { this.url = null; } /** Returns true if field url is set (has been assigned a value) and false otherwise */ public boolean isSetUrl() { return this.url != null; } public void setUrlIsSet(boolean value) { if (!value) { this.url = null; } } public String getName() { return this.name; } public FileData setName(String name) { this.name = name; return this; } public void unsetName() { this.name = null; } /** Returns true if field name is set (has been assigned a value) and false otherwise */ public boolean isSetName() { return this.name != null; } public void setNameIsSet(boolean value) { if (!value) { this.name = null; } } public String getPlugin() { return this.plugin; } public FileData setPlugin(String plugin) { this.plugin = plugin; return this; } public void unsetPlugin() { this.plugin = null; } /** Returns true if field plugin is set (has been assigned a value) and false otherwise */ public boolean isSetPlugin() { return this.plugin != null; } public void setPluginIsSet(boolean value) { if (!value) { this.plugin = null; } } public long getSize() { return this.size; } public FileData setSize(long size) { this.size = size; setSizeIsSet(true); return this; } public void unsetSize() { __isset_bit_vector.clear(__SIZE_ISSET_ID); } /** Returns true if field size is set (has been assigned a value) and false otherwise */ public boolean isSetSize() { return __isset_bit_vector.get(__SIZE_ISSET_ID); } public void setSizeIsSet(boolean value) { __isset_bit_vector.set(__SIZE_ISSET_ID, value); } public String getFormat_size() { return this.format_size; } public FileData setFormat_size(String format_size) { this.format_size = format_size; return this; } public void unsetFormat_size() { this.format_size = null; } /** Returns true if field format_size is set (has been assigned a value) and false otherwise */ public boolean isSetFormat_size() { return this.format_size != null; } public void setFormat_sizeIsSet(boolean value) { if (!value) { this.format_size = null; } } /** * * @see DownloadStatus */ public DownloadStatus getStatus() { return this.status; } /** * * @see DownloadStatus */ public FileData setStatus(DownloadStatus status) { this.status = status; return this; } public void unsetStatus() { this.status = null; } /** Returns true if field status is set (has been assigned a value) and false otherwise */ public boolean isSetStatus() { return this.status != null; } public void setStatusIsSet(boolean value) { if (!value) { this.status = null; } } public String getStatusmsg() { return this.statusmsg; } public FileData setStatusmsg(String statusmsg) { this.statusmsg = statusmsg; return this; } public void unsetStatusmsg() { this.statusmsg = null; } /** Returns true if field statusmsg is set (has been assigned a value) and false otherwise */ public boolean isSetStatusmsg() { return this.statusmsg != null; } public void setStatusmsgIsSet(boolean value) { if (!value) { this.statusmsg = null; } } public int getPackageID() { return this.packageID; } public FileData setPackageID(int packageID) { this.packageID = packageID; setPackageIDIsSet(true); return this; } public void unsetPackageID() { __isset_bit_vector.clear(__PACKAGEID_ISSET_ID); } /** Returns true if field packageID is set (has been assigned a value) and false otherwise */ public boolean isSetPackageID() { return __isset_bit_vector.get(__PACKAGEID_ISSET_ID); } public void setPackageIDIsSet(boolean value) { __isset_bit_vector.set(__PACKAGEID_ISSET_ID, value); } public String getError() { return this.error; } public FileData setError(String error) { this.error = error; return this; } public void unsetError() { this.error = null; } /** Returns true if field error is set (has been assigned a value) and false otherwise */ public boolean isSetError() { return this.error != null; } public void setErrorIsSet(boolean value) { if (!value) { this.error = null; } } public short getOrder() { return this.order; } public FileData setOrder(short order) { this.order = order; setOrderIsSet(true); return this; } public void unsetOrder() { __isset_bit_vector.clear(__ORDER_ISSET_ID); } /** Returns true if field order is set (has been assigned a value) and false otherwise */ public boolean isSetOrder() { return __isset_bit_vector.get(__ORDER_ISSET_ID); } public void setOrderIsSet(boolean value) { __isset_bit_vector.set(__ORDER_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FID: if (value == null) { unsetFid(); } else { setFid((Integer)value); } break; case URL: if (value == null) { unsetUrl(); } else { setUrl((String)value); } break; case NAME: if (value == null) { unsetName(); } else { setName((String)value); } break; case PLUGIN: if (value == null) { unsetPlugin(); } else { setPlugin((String)value); } break; case SIZE: if (value == null) { unsetSize(); } else { setSize((Long)value); } break; case FORMAT_SIZE: if (value == null) { unsetFormat_size(); } else { setFormat_size((String)value); } break; case STATUS: if (value == null) { unsetStatus(); } else { setStatus((DownloadStatus)value); } break; case STATUSMSG: if (value == null) { unsetStatusmsg(); } else { setStatusmsg((String)value); } break; case PACKAGE_ID: if (value == null) { unsetPackageID(); } else { setPackageID((Integer)value); } break; case ERROR: if (value == null) { unsetError(); } else { setError((String)value); } break; case ORDER: if (value == null) { unsetOrder(); } else { setOrder((Short)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FID: return Integer.valueOf(getFid()); case URL: return getUrl(); case NAME: return getName(); case PLUGIN: return getPlugin(); case SIZE: return Long.valueOf(getSize()); case FORMAT_SIZE: return getFormat_size(); case STATUS: return getStatus(); case STATUSMSG: return getStatusmsg(); case PACKAGE_ID: return Integer.valueOf(getPackageID()); case ERROR: return getError(); case ORDER: return Short.valueOf(getOrder()); } 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 FID: return isSetFid(); case URL: return isSetUrl(); case NAME: return isSetName(); case PLUGIN: return isSetPlugin(); case SIZE: return isSetSize(); case FORMAT_SIZE: return isSetFormat_size(); case STATUS: return isSetStatus(); case STATUSMSG: return isSetStatusmsg(); case PACKAGE_ID: return isSetPackageID(); case ERROR: return isSetError(); case ORDER: return isSetOrder(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof FileData) return this.equals((FileData)that); return false; } public boolean equals(FileData that) { if (that == null) return false; boolean this_present_fid = true; boolean that_present_fid = true; if (this_present_fid || that_present_fid) { if (!(this_present_fid && that_present_fid)) return false; if (this.fid != that.fid) return false; } boolean this_present_url = true && this.isSetUrl(); boolean that_present_url = true && that.isSetUrl(); if (this_present_url || that_present_url) { if (!(this_present_url && that_present_url)) return false; if (!this.url.equals(that.url)) return false; } boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) return false; if (!this.name.equals(that.name)) return false; } boolean this_present_plugin = true && this.isSetPlugin(); boolean that_present_plugin = true && that.isSetPlugin(); if (this_present_plugin || that_present_plugin) { if (!(this_present_plugin && that_present_plugin)) return false; if (!this.plugin.equals(that.plugin)) return false; } boolean this_present_size = true; boolean that_present_size = true; if (this_present_size || that_present_size) { if (!(this_present_size && that_present_size)) return false; if (this.size != that.size) return false; } boolean this_present_format_size = true && this.isSetFormat_size(); boolean that_present_format_size = true && that.isSetFormat_size(); if (this_present_format_size || that_present_format_size) { if (!(this_present_format_size && that_present_format_size)) return false; if (!this.format_size.equals(that.format_size)) return false; } boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); if (this_present_status || that_present_status) { if (!(this_present_status && that_present_status)) return false; if (!this.status.equals(that.status)) return false; } boolean this_present_statusmsg = true && this.isSetStatusmsg(); boolean that_present_statusmsg = true && that.isSetStatusmsg(); if (this_present_statusmsg || that_present_statusmsg) { if (!(this_present_statusmsg && that_present_statusmsg)) return false; if (!this.statusmsg.equals(that.statusmsg)) return false; } boolean this_present_packageID = true; boolean that_present_packageID = true; if (this_present_packageID || that_present_packageID) { if (!(this_present_packageID && that_present_packageID)) return false; if (this.packageID != that.packageID) return false; } boolean this_present_error = true && this.isSetError(); boolean that_present_error = true && that.isSetError(); if (this_present_error || that_present_error) { if (!(this_present_error && that_present_error)) return false; if (!this.error.equals(that.error)) return false; } boolean this_present_order = true; boolean that_present_order = true; if (this_present_order || that_present_order) { if (!(this_present_order && that_present_order)) return false; if (this.order != that.order) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(FileData other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; FileData typedOther = (FileData)other; lastComparison = Boolean.valueOf(isSetFid()).compareTo(typedOther.isSetFid()); if (lastComparison != 0) { return lastComparison; } if (isSetFid()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fid, typedOther.fid); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUrl()).compareTo(typedOther.isSetUrl()); if (lastComparison != 0) { return lastComparison; } if (isSetUrl()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.url, typedOther.url); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); if (lastComparison != 0) { return lastComparison; } if (isSetName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPlugin()).compareTo(typedOther.isSetPlugin()); if (lastComparison != 0) { return lastComparison; } if (isSetPlugin()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.plugin, typedOther.plugin); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSize()).compareTo(typedOther.isSetSize()); if (lastComparison != 0) { return lastComparison; } if (isSetSize()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, typedOther.size); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFormat_size()).compareTo(typedOther.isSetFormat_size()); if (lastComparison != 0) { return lastComparison; } if (isSetFormat_size()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.format_size, typedOther.format_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); if (lastComparison != 0) { return lastComparison; } if (isSetStatus()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStatusmsg()).compareTo(typedOther.isSetStatusmsg()); if (lastComparison != 0) { return lastComparison; } if (isSetStatusmsg()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusmsg, typedOther.statusmsg); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPackageID()).compareTo(typedOther.isSetPackageID()); if (lastComparison != 0) { return lastComparison; } if (isSetPackageID()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.packageID, typedOther.packageID); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetError()).compareTo(typedOther.isSetError()); if (lastComparison != 0) { return lastComparison; } if (isSetError()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, typedOther.error); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetOrder()).compareTo(typedOther.isSetOrder()); if (lastComparison != 0) { return lastComparison; } if (isSetOrder()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.order, typedOther.order); 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("FileData("); boolean first = true; sb.append("fid:"); sb.append(this.fid); first = false; if (!first) sb.append(", "); sb.append("url:"); if (this.url == null) { sb.append("null"); } else { sb.append(this.url); } first = false; if (!first) sb.append(", "); sb.append("name:"); if (this.name == null) { sb.append("null"); } else { sb.append(this.name); } first = false; if (!first) sb.append(", "); sb.append("plugin:"); if (this.plugin == null) { sb.append("null"); } else { sb.append(this.plugin); } first = false; if (!first) sb.append(", "); sb.append("size:"); sb.append(this.size); first = false; if (!first) sb.append(", "); sb.append("format_size:"); if (this.format_size == null) { sb.append("null"); } else { sb.append(this.format_size); } first = false; if (!first) sb.append(", "); sb.append("status:"); if (this.status == null) { sb.append("null"); } else { sb.append(this.status); } first = false; if (!first) sb.append(", "); sb.append("statusmsg:"); if (this.statusmsg == null) { sb.append("null"); } else { sb.append(this.statusmsg); } first = false; if (!first) sb.append(", "); sb.append("packageID:"); sb.append(this.packageID); first = false; if (!first) sb.append(", "); sb.append("error:"); if (this.error == null) { sb.append("null"); } else { sb.append(this.error); } first = false; if (!first) sb.append(", "); sb.append("order:"); sb.append(this.order); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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.getMessage()); } } 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_bit_vector = new BitSet(1); 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.getMessage()); } } private static class FileDataStandardSchemeFactory implements SchemeFactory { public FileDataStandardScheme getScheme() { return new FileDataStandardScheme(); } } private static class FileDataStandardScheme extends StandardScheme<FileData> { public void read(org.apache.thrift.protocol.TProtocol iprot, FileData 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: // FID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fid = iprot.readI32(); struct.setFidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // URL if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.url = iprot.readString(); struct.setUrlIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.name = iprot.readString(); struct.setNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // PLUGIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.plugin = iprot.readString(); struct.setPluginIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.size = iprot.readI64(); struct.setSizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // FORMAT_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.format_size = iprot.readString(); struct.setFormat_sizeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // STATUS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.status = DownloadStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // STATUSMSG if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.statusmsg = iprot.readString(); struct.setStatusmsgIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // PACKAGE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.packageID = iprot.readI32(); struct.setPackageIDIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // ERROR if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.error = iprot.readString(); struct.setErrorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // ORDER if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.order = iprot.readI16(); struct.setOrderIsSet(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, FileData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FID_FIELD_DESC); oprot.writeI32(struct.fid); oprot.writeFieldEnd(); if (struct.url != null) { oprot.writeFieldBegin(URL_FIELD_DESC); oprot.writeString(struct.url); oprot.writeFieldEnd(); } if (struct.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(struct.name); oprot.writeFieldEnd(); } if (struct.plugin != null) { oprot.writeFieldBegin(PLUGIN_FIELD_DESC); oprot.writeString(struct.plugin); oprot.writeFieldEnd(); } oprot.writeFieldBegin(SIZE_FIELD_DESC); oprot.writeI64(struct.size); oprot.writeFieldEnd(); if (struct.format_size != null) { oprot.writeFieldBegin(FORMAT_SIZE_FIELD_DESC); oprot.writeString(struct.format_size); oprot.writeFieldEnd(); } if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); oprot.writeI32(struct.status.getValue()); oprot.writeFieldEnd(); } if (struct.statusmsg != null) { oprot.writeFieldBegin(STATUSMSG_FIELD_DESC); oprot.writeString(struct.statusmsg); oprot.writeFieldEnd(); } oprot.writeFieldBegin(PACKAGE_ID_FIELD_DESC); oprot.writeI32(struct.packageID); oprot.writeFieldEnd(); if (struct.error != null) { oprot.writeFieldBegin(ERROR_FIELD_DESC); oprot.writeString(struct.error); oprot.writeFieldEnd(); } oprot.writeFieldBegin(ORDER_FIELD_DESC); oprot.writeI16(struct.order); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class FileDataTupleSchemeFactory implements SchemeFactory { public FileDataTupleScheme getScheme() { return new FileDataTupleScheme(); } } private static class FileDataTupleScheme extends TupleScheme<FileData> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, FileData struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFid()) { optionals.set(0); } if (struct.isSetUrl()) { optionals.set(1); } if (struct.isSetName()) { optionals.set(2); } if (struct.isSetPlugin()) { optionals.set(3); } if (struct.isSetSize()) { optionals.set(4); } if (struct.isSetFormat_size()) { optionals.set(5); } if (struct.isSetStatus()) { optionals.set(6); } if (struct.isSetStatusmsg()) { optionals.set(7); } if (struct.isSetPackageID()) { optionals.set(8); } if (struct.isSetError()) { optionals.set(9); } if (struct.isSetOrder()) { optionals.set(10); } oprot.writeBitSet(optionals, 11); if (struct.isSetFid()) { oprot.writeI32(struct.fid); } if (struct.isSetUrl()) { oprot.writeString(struct.url); } if (struct.isSetName()) { oprot.writeString(struct.name); } if (struct.isSetPlugin()) { oprot.writeString(struct.plugin); } if (struct.isSetSize()) { oprot.writeI64(struct.size); } if (struct.isSetFormat_size()) { oprot.writeString(struct.format_size); } if (struct.isSetStatus()) { oprot.writeI32(struct.status.getValue()); } if (struct.isSetStatusmsg()) { oprot.writeString(struct.statusmsg); } if (struct.isSetPackageID()) { oprot.writeI32(struct.packageID); } if (struct.isSetError()) { oprot.writeString(struct.error); } if (struct.isSetOrder()) { oprot.writeI16(struct.order); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, FileData struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { struct.fid = iprot.readI32(); struct.setFidIsSet(true); } if (incoming.get(1)) { struct.url = iprot.readString(); struct.setUrlIsSet(true); } if (incoming.get(2)) { struct.name = iprot.readString(); struct.setNameIsSet(true); } if (incoming.get(3)) { struct.plugin = iprot.readString(); struct.setPluginIsSet(true); } if (incoming.get(4)) { struct.size = iprot.readI64(); struct.setSizeIsSet(true); } if (incoming.get(5)) { struct.format_size = iprot.readString(); struct.setFormat_sizeIsSet(true); } if (incoming.get(6)) { struct.status = DownloadStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); } if (incoming.get(7)) { struct.statusmsg = iprot.readString(); struct.setStatusmsgIsSet(true); } if (incoming.get(8)) { struct.packageID = iprot.readI32(); struct.setPackageIDIsSet(true); } if (incoming.get(9)) { struct.error = iprot.readString(); struct.setErrorIsSet(true); } if (incoming.get(10)) { struct.order = iprot.readI16(); struct.setOrderIsSet(true); } } } }