/**
* 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 DownloadInfo implements org.apache.thrift.TBase<DownloadInfo, DownloadInfo._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DownloadInfo");
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 NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField SPEED_FIELD_DESC = new org.apache.thrift.protocol.TField("speed", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField ETA_FIELD_DESC = new org.apache.thrift.protocol.TField("eta", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField FORMAT_ETA_FIELD_DESC = new org.apache.thrift.protocol.TField("format_eta", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField BLEFT_FIELD_DESC = new org.apache.thrift.protocol.TField("bleft", org.apache.thrift.protocol.TType.I64, (short)6);
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)7);
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)8);
private static final org.apache.thrift.protocol.TField PERCENT_FIELD_DESC = new org.apache.thrift.protocol.TField("percent", org.apache.thrift.protocol.TType.BYTE, (short)9);
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)10);
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)11);
private static final org.apache.thrift.protocol.TField FORMAT_WAIT_FIELD_DESC = new org.apache.thrift.protocol.TField("format_wait", org.apache.thrift.protocol.TType.STRING, (short)12);
private static final org.apache.thrift.protocol.TField WAIT_UNTIL_FIELD_DESC = new org.apache.thrift.protocol.TField("wait_until", org.apache.thrift.protocol.TType.I64, (short)13);
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)14);
private static final org.apache.thrift.protocol.TField PACKAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("packageName", org.apache.thrift.protocol.TType.STRING, (short)15);
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)16);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new DownloadInfoStandardSchemeFactory());
schemes.put(TupleScheme.class, new DownloadInfoTupleSchemeFactory());
}
public int fid; // required
public String name; // required
public long speed; // required
public int eta; // required
public String format_eta; // required
public long bleft; // required
public long size; // required
public String format_size; // required
public byte percent; // required
/**
*
* @see DownloadStatus
*/
public DownloadStatus status; // required
public String statusmsg; // required
public String format_wait; // required
public long wait_until; // required
public int packageID; // required
public String packageName; // required
public String plugin; // 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"),
NAME((short)2, "name"),
SPEED((short)3, "speed"),
ETA((short)4, "eta"),
FORMAT_ETA((short)5, "format_eta"),
BLEFT((short)6, "bleft"),
SIZE((short)7, "size"),
FORMAT_SIZE((short)8, "format_size"),
PERCENT((short)9, "percent"),
/**
*
* @see DownloadStatus
*/
STATUS((short)10, "status"),
STATUSMSG((short)11, "statusmsg"),
FORMAT_WAIT((short)12, "format_wait"),
WAIT_UNTIL((short)13, "wait_until"),
PACKAGE_ID((short)14, "packageID"),
PACKAGE_NAME((short)15, "packageName"),
PLUGIN((short)16, "plugin");
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: // NAME
return NAME;
case 3: // SPEED
return SPEED;
case 4: // ETA
return ETA;
case 5: // FORMAT_ETA
return FORMAT_ETA;
case 6: // BLEFT
return BLEFT;
case 7: // SIZE
return SIZE;
case 8: // FORMAT_SIZE
return FORMAT_SIZE;
case 9: // PERCENT
return PERCENT;
case 10: // STATUS
return STATUS;
case 11: // STATUSMSG
return STATUSMSG;
case 12: // FORMAT_WAIT
return FORMAT_WAIT;
case 13: // WAIT_UNTIL
return WAIT_UNTIL;
case 14: // PACKAGE_ID
return PACKAGE_ID;
case 15: // PACKAGE_NAME
return PACKAGE_NAME;
case 16: // PLUGIN
return PLUGIN;
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 __SPEED_ISSET_ID = 1;
private static final int __ETA_ISSET_ID = 2;
private static final int __BLEFT_ISSET_ID = 3;
private static final int __SIZE_ISSET_ID = 4;
private static final int __PERCENT_ISSET_ID = 5;
private static final int __WAIT_UNTIL_ISSET_ID = 6;
private static final int __PACKAGEID_ISSET_ID = 7;
private BitSet __isset_bit_vector = new BitSet(8);
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.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.SPEED, new org.apache.thrift.meta_data.FieldMetaData("speed", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.ETA, new org.apache.thrift.meta_data.FieldMetaData("eta", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.FORMAT_ETA, new org.apache.thrift.meta_data.FieldMetaData("format_eta", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.BLEFT, new org.apache.thrift.meta_data.FieldMetaData("bleft", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
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.PERCENT, new org.apache.thrift.meta_data.FieldMetaData("percent", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE , "Progress")));
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.FORMAT_WAIT, new org.apache.thrift.meta_data.FieldMetaData("format_wait", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.WAIT_UNTIL, new org.apache.thrift.meta_data.FieldMetaData("wait_until", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
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.PACKAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("packageName", 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")));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DownloadInfo.class, metaDataMap);
}
public DownloadInfo() {
}
public DownloadInfo(
int fid,
String name,
long speed,
int eta,
String format_eta,
long bleft,
long size,
String format_size,
byte percent,
DownloadStatus status,
String statusmsg,
String format_wait,
long wait_until,
int packageID,
String packageName,
String plugin)
{
this();
this.fid = fid;
setFidIsSet(true);
this.name = name;
this.speed = speed;
setSpeedIsSet(true);
this.eta = eta;
setEtaIsSet(true);
this.format_eta = format_eta;
this.bleft = bleft;
setBleftIsSet(true);
this.size = size;
setSizeIsSet(true);
this.format_size = format_size;
this.percent = percent;
setPercentIsSet(true);
this.status = status;
this.statusmsg = statusmsg;
this.format_wait = format_wait;
this.wait_until = wait_until;
setWait_untilIsSet(true);
this.packageID = packageID;
setPackageIDIsSet(true);
this.packageName = packageName;
this.plugin = plugin;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public DownloadInfo(DownloadInfo other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.fid = other.fid;
if (other.isSetName()) {
this.name = other.name;
}
this.speed = other.speed;
this.eta = other.eta;
if (other.isSetFormat_eta()) {
this.format_eta = other.format_eta;
}
this.bleft = other.bleft;
this.size = other.size;
if (other.isSetFormat_size()) {
this.format_size = other.format_size;
}
this.percent = other.percent;
if (other.isSetStatus()) {
this.status = other.status;
}
if (other.isSetStatusmsg()) {
this.statusmsg = other.statusmsg;
}
if (other.isSetFormat_wait()) {
this.format_wait = other.format_wait;
}
this.wait_until = other.wait_until;
this.packageID = other.packageID;
if (other.isSetPackageName()) {
this.packageName = other.packageName;
}
if (other.isSetPlugin()) {
this.plugin = other.plugin;
}
}
public DownloadInfo deepCopy() {
return new DownloadInfo(this);
}
@Override
public void clear() {
setFidIsSet(false);
this.fid = 0;
this.name = null;
setSpeedIsSet(false);
this.speed = 0;
setEtaIsSet(false);
this.eta = 0;
this.format_eta = null;
setBleftIsSet(false);
this.bleft = 0;
setSizeIsSet(false);
this.size = 0;
this.format_size = null;
setPercentIsSet(false);
this.percent = 0;
this.status = null;
this.statusmsg = null;
this.format_wait = null;
setWait_untilIsSet(false);
this.wait_until = 0;
setPackageIDIsSet(false);
this.packageID = 0;
this.packageName = null;
this.plugin = null;
}
public int getFid() {
return this.fid;
}
public DownloadInfo 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 getName() {
return this.name;
}
public DownloadInfo 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 long getSpeed() {
return this.speed;
}
public DownloadInfo setSpeed(long speed) {
this.speed = speed;
setSpeedIsSet(true);
return this;
}
public void unsetSpeed() {
__isset_bit_vector.clear(__SPEED_ISSET_ID);
}
/** Returns true if field speed is set (has been assigned a value) and false otherwise */
public boolean isSetSpeed() {
return __isset_bit_vector.get(__SPEED_ISSET_ID);
}
public void setSpeedIsSet(boolean value) {
__isset_bit_vector.set(__SPEED_ISSET_ID, value);
}
public int getEta() {
return this.eta;
}
public DownloadInfo setEta(int eta) {
this.eta = eta;
setEtaIsSet(true);
return this;
}
public void unsetEta() {
__isset_bit_vector.clear(__ETA_ISSET_ID);
}
/** Returns true if field eta is set (has been assigned a value) and false otherwise */
public boolean isSetEta() {
return __isset_bit_vector.get(__ETA_ISSET_ID);
}
public void setEtaIsSet(boolean value) {
__isset_bit_vector.set(__ETA_ISSET_ID, value);
}
public String getFormat_eta() {
return this.format_eta;
}
public DownloadInfo setFormat_eta(String format_eta) {
this.format_eta = format_eta;
return this;
}
public void unsetFormat_eta() {
this.format_eta = null;
}
/** Returns true if field format_eta is set (has been assigned a value) and false otherwise */
public boolean isSetFormat_eta() {
return this.format_eta != null;
}
public void setFormat_etaIsSet(boolean value) {
if (!value) {
this.format_eta = null;
}
}
public long getBleft() {
return this.bleft;
}
public DownloadInfo setBleft(long bleft) {
this.bleft = bleft;
setBleftIsSet(true);
return this;
}
public void unsetBleft() {
__isset_bit_vector.clear(__BLEFT_ISSET_ID);
}
/** Returns true if field bleft is set (has been assigned a value) and false otherwise */
public boolean isSetBleft() {
return __isset_bit_vector.get(__BLEFT_ISSET_ID);
}
public void setBleftIsSet(boolean value) {
__isset_bit_vector.set(__BLEFT_ISSET_ID, value);
}
public long getSize() {
return this.size;
}
public DownloadInfo 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 DownloadInfo 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;
}
}
public byte getPercent() {
return this.percent;
}
public DownloadInfo setPercent(byte percent) {
this.percent = percent;
setPercentIsSet(true);
return this;
}
public void unsetPercent() {
__isset_bit_vector.clear(__PERCENT_ISSET_ID);
}
/** Returns true if field percent is set (has been assigned a value) and false otherwise */
public boolean isSetPercent() {
return __isset_bit_vector.get(__PERCENT_ISSET_ID);
}
public void setPercentIsSet(boolean value) {
__isset_bit_vector.set(__PERCENT_ISSET_ID, value);
}
/**
*
* @see DownloadStatus
*/
public DownloadStatus getStatus() {
return this.status;
}
/**
*
* @see DownloadStatus
*/
public DownloadInfo 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 DownloadInfo 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 String getFormat_wait() {
return this.format_wait;
}
public DownloadInfo setFormat_wait(String format_wait) {
this.format_wait = format_wait;
return this;
}
public void unsetFormat_wait() {
this.format_wait = null;
}
/** Returns true if field format_wait is set (has been assigned a value) and false otherwise */
public boolean isSetFormat_wait() {
return this.format_wait != null;
}
public void setFormat_waitIsSet(boolean value) {
if (!value) {
this.format_wait = null;
}
}
public long getWait_until() {
return this.wait_until;
}
public DownloadInfo setWait_until(long wait_until) {
this.wait_until = wait_until;
setWait_untilIsSet(true);
return this;
}
public void unsetWait_until() {
__isset_bit_vector.clear(__WAIT_UNTIL_ISSET_ID);
}
/** Returns true if field wait_until is set (has been assigned a value) and false otherwise */
public boolean isSetWait_until() {
return __isset_bit_vector.get(__WAIT_UNTIL_ISSET_ID);
}
public void setWait_untilIsSet(boolean value) {
__isset_bit_vector.set(__WAIT_UNTIL_ISSET_ID, value);
}
public int getPackageID() {
return this.packageID;
}
public DownloadInfo 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 getPackageName() {
return this.packageName;
}
public DownloadInfo setPackageName(String packageName) {
this.packageName = packageName;
return this;
}
public void unsetPackageName() {
this.packageName = null;
}
/** Returns true if field packageName is set (has been assigned a value) and false otherwise */
public boolean isSetPackageName() {
return this.packageName != null;
}
public void setPackageNameIsSet(boolean value) {
if (!value) {
this.packageName = null;
}
}
public String getPlugin() {
return this.plugin;
}
public DownloadInfo 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 void setFieldValue(_Fields field, Object value) {
switch (field) {
case FID:
if (value == null) {
unsetFid();
} else {
setFid((Integer)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case SPEED:
if (value == null) {
unsetSpeed();
} else {
setSpeed((Long)value);
}
break;
case ETA:
if (value == null) {
unsetEta();
} else {
setEta((Integer)value);
}
break;
case FORMAT_ETA:
if (value == null) {
unsetFormat_eta();
} else {
setFormat_eta((String)value);
}
break;
case BLEFT:
if (value == null) {
unsetBleft();
} else {
setBleft((Long)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 PERCENT:
if (value == null) {
unsetPercent();
} else {
setPercent((Byte)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 FORMAT_WAIT:
if (value == null) {
unsetFormat_wait();
} else {
setFormat_wait((String)value);
}
break;
case WAIT_UNTIL:
if (value == null) {
unsetWait_until();
} else {
setWait_until((Long)value);
}
break;
case PACKAGE_ID:
if (value == null) {
unsetPackageID();
} else {
setPackageID((Integer)value);
}
break;
case PACKAGE_NAME:
if (value == null) {
unsetPackageName();
} else {
setPackageName((String)value);
}
break;
case PLUGIN:
if (value == null) {
unsetPlugin();
} else {
setPlugin((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case FID:
return Integer.valueOf(getFid());
case NAME:
return getName();
case SPEED:
return Long.valueOf(getSpeed());
case ETA:
return Integer.valueOf(getEta());
case FORMAT_ETA:
return getFormat_eta();
case BLEFT:
return Long.valueOf(getBleft());
case SIZE:
return Long.valueOf(getSize());
case FORMAT_SIZE:
return getFormat_size();
case PERCENT:
return Byte.valueOf(getPercent());
case STATUS:
return getStatus();
case STATUSMSG:
return getStatusmsg();
case FORMAT_WAIT:
return getFormat_wait();
case WAIT_UNTIL:
return Long.valueOf(getWait_until());
case PACKAGE_ID:
return Integer.valueOf(getPackageID());
case PACKAGE_NAME:
return getPackageName();
case PLUGIN:
return getPlugin();
}
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 NAME:
return isSetName();
case SPEED:
return isSetSpeed();
case ETA:
return isSetEta();
case FORMAT_ETA:
return isSetFormat_eta();
case BLEFT:
return isSetBleft();
case SIZE:
return isSetSize();
case FORMAT_SIZE:
return isSetFormat_size();
case PERCENT:
return isSetPercent();
case STATUS:
return isSetStatus();
case STATUSMSG:
return isSetStatusmsg();
case FORMAT_WAIT:
return isSetFormat_wait();
case WAIT_UNTIL:
return isSetWait_until();
case PACKAGE_ID:
return isSetPackageID();
case PACKAGE_NAME:
return isSetPackageName();
case PLUGIN:
return isSetPlugin();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof DownloadInfo)
return this.equals((DownloadInfo)that);
return false;
}
public boolean equals(DownloadInfo 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_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_speed = true;
boolean that_present_speed = true;
if (this_present_speed || that_present_speed) {
if (!(this_present_speed && that_present_speed))
return false;
if (this.speed != that.speed)
return false;
}
boolean this_present_eta = true;
boolean that_present_eta = true;
if (this_present_eta || that_present_eta) {
if (!(this_present_eta && that_present_eta))
return false;
if (this.eta != that.eta)
return false;
}
boolean this_present_format_eta = true && this.isSetFormat_eta();
boolean that_present_format_eta = true && that.isSetFormat_eta();
if (this_present_format_eta || that_present_format_eta) {
if (!(this_present_format_eta && that_present_format_eta))
return false;
if (!this.format_eta.equals(that.format_eta))
return false;
}
boolean this_present_bleft = true;
boolean that_present_bleft = true;
if (this_present_bleft || that_present_bleft) {
if (!(this_present_bleft && that_present_bleft))
return false;
if (this.bleft != that.bleft)
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_percent = true;
boolean that_present_percent = true;
if (this_present_percent || that_present_percent) {
if (!(this_present_percent && that_present_percent))
return false;
if (this.percent != that.percent)
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_format_wait = true && this.isSetFormat_wait();
boolean that_present_format_wait = true && that.isSetFormat_wait();
if (this_present_format_wait || that_present_format_wait) {
if (!(this_present_format_wait && that_present_format_wait))
return false;
if (!this.format_wait.equals(that.format_wait))
return false;
}
boolean this_present_wait_until = true;
boolean that_present_wait_until = true;
if (this_present_wait_until || that_present_wait_until) {
if (!(this_present_wait_until && that_present_wait_until))
return false;
if (this.wait_until != that.wait_until)
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_packageName = true && this.isSetPackageName();
boolean that_present_packageName = true && that.isSetPackageName();
if (this_present_packageName || that_present_packageName) {
if (!(this_present_packageName && that_present_packageName))
return false;
if (!this.packageName.equals(that.packageName))
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;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(DownloadInfo other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
DownloadInfo typedOther = (DownloadInfo)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(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(isSetSpeed()).compareTo(typedOther.isSetSpeed());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSpeed()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.speed, typedOther.speed);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEta()).compareTo(typedOther.isSetEta());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEta()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eta, typedOther.eta);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetFormat_eta()).compareTo(typedOther.isSetFormat_eta());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFormat_eta()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.format_eta, typedOther.format_eta);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBleft()).compareTo(typedOther.isSetBleft());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBleft()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bleft, typedOther.bleft);
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(isSetPercent()).compareTo(typedOther.isSetPercent());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPercent()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.percent, typedOther.percent);
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(isSetFormat_wait()).compareTo(typedOther.isSetFormat_wait());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFormat_wait()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.format_wait, typedOther.format_wait);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetWait_until()).compareTo(typedOther.isSetWait_until());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetWait_until()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_until, typedOther.wait_until);
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(isSetPackageName()).compareTo(typedOther.isSetPackageName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPackageName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.packageName, typedOther.packageName);
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;
}
}
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("DownloadInfo(");
boolean first = true;
sb.append("fid:");
sb.append(this.fid);
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("speed:");
sb.append(this.speed);
first = false;
if (!first) sb.append(", ");
sb.append("eta:");
sb.append(this.eta);
first = false;
if (!first) sb.append(", ");
sb.append("format_eta:");
if (this.format_eta == null) {
sb.append("null");
} else {
sb.append(this.format_eta);
}
first = false;
if (!first) sb.append(", ");
sb.append("bleft:");
sb.append(this.bleft);
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("percent:");
sb.append(this.percent);
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("format_wait:");
if (this.format_wait == null) {
sb.append("null");
} else {
sb.append(this.format_wait);
}
first = false;
if (!first) sb.append(", ");
sb.append("wait_until:");
sb.append(this.wait_until);
first = false;
if (!first) sb.append(", ");
sb.append("packageID:");
sb.append(this.packageID);
first = false;
if (!first) sb.append(", ");
sb.append("packageName:");
if (this.packageName == null) {
sb.append("null");
} else {
sb.append(this.packageName);
}
first = false;
if (!first) sb.append(", ");
sb.append("plugin:");
if (this.plugin == null) {
sb.append("null");
} else {
sb.append(this.plugin);
}
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 DownloadInfoStandardSchemeFactory implements SchemeFactory {
public DownloadInfoStandardScheme getScheme() {
return new DownloadInfoStandardScheme();
}
}
private static class DownloadInfoStandardScheme extends StandardScheme<DownloadInfo> {
public void read(org.apache.thrift.protocol.TProtocol iprot, DownloadInfo 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: // 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 3: // SPEED
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.speed = iprot.readI64();
struct.setSpeedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // ETA
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.eta = iprot.readI32();
struct.setEtaIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // FORMAT_ETA
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.format_eta = iprot.readString();
struct.setFormat_etaIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // BLEFT
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.bleft = iprot.readI64();
struct.setBleftIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // 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 8: // 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 9: // PERCENT
if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
struct.percent = iprot.readByte();
struct.setPercentIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // 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 11: // 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 12: // FORMAT_WAIT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.format_wait = iprot.readString();
struct.setFormat_waitIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // WAIT_UNTIL
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.wait_until = iprot.readI64();
struct.setWait_untilIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 14: // 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 15: // PACKAGE_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.packageName = iprot.readString();
struct.setPackageNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 16: // 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;
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, DownloadInfo 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.name != null) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(SPEED_FIELD_DESC);
oprot.writeI64(struct.speed);
oprot.writeFieldEnd();
oprot.writeFieldBegin(ETA_FIELD_DESC);
oprot.writeI32(struct.eta);
oprot.writeFieldEnd();
if (struct.format_eta != null) {
oprot.writeFieldBegin(FORMAT_ETA_FIELD_DESC);
oprot.writeString(struct.format_eta);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(BLEFT_FIELD_DESC);
oprot.writeI64(struct.bleft);
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();
}
oprot.writeFieldBegin(PERCENT_FIELD_DESC);
oprot.writeByte(struct.percent);
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();
}
if (struct.format_wait != null) {
oprot.writeFieldBegin(FORMAT_WAIT_FIELD_DESC);
oprot.writeString(struct.format_wait);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(WAIT_UNTIL_FIELD_DESC);
oprot.writeI64(struct.wait_until);
oprot.writeFieldEnd();
oprot.writeFieldBegin(PACKAGE_ID_FIELD_DESC);
oprot.writeI32(struct.packageID);
oprot.writeFieldEnd();
if (struct.packageName != null) {
oprot.writeFieldBegin(PACKAGE_NAME_FIELD_DESC);
oprot.writeString(struct.packageName);
oprot.writeFieldEnd();
}
if (struct.plugin != null) {
oprot.writeFieldBegin(PLUGIN_FIELD_DESC);
oprot.writeString(struct.plugin);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class DownloadInfoTupleSchemeFactory implements SchemeFactory {
public DownloadInfoTupleScheme getScheme() {
return new DownloadInfoTupleScheme();
}
}
private static class DownloadInfoTupleScheme extends TupleScheme<DownloadInfo> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DownloadInfo struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetFid()) {
optionals.set(0);
}
if (struct.isSetName()) {
optionals.set(1);
}
if (struct.isSetSpeed()) {
optionals.set(2);
}
if (struct.isSetEta()) {
optionals.set(3);
}
if (struct.isSetFormat_eta()) {
optionals.set(4);
}
if (struct.isSetBleft()) {
optionals.set(5);
}
if (struct.isSetSize()) {
optionals.set(6);
}
if (struct.isSetFormat_size()) {
optionals.set(7);
}
if (struct.isSetPercent()) {
optionals.set(8);
}
if (struct.isSetStatus()) {
optionals.set(9);
}
if (struct.isSetStatusmsg()) {
optionals.set(10);
}
if (struct.isSetFormat_wait()) {
optionals.set(11);
}
if (struct.isSetWait_until()) {
optionals.set(12);
}
if (struct.isSetPackageID()) {
optionals.set(13);
}
if (struct.isSetPackageName()) {
optionals.set(14);
}
if (struct.isSetPlugin()) {
optionals.set(15);
}
oprot.writeBitSet(optionals, 16);
if (struct.isSetFid()) {
oprot.writeI32(struct.fid);
}
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
if (struct.isSetSpeed()) {
oprot.writeI64(struct.speed);
}
if (struct.isSetEta()) {
oprot.writeI32(struct.eta);
}
if (struct.isSetFormat_eta()) {
oprot.writeString(struct.format_eta);
}
if (struct.isSetBleft()) {
oprot.writeI64(struct.bleft);
}
if (struct.isSetSize()) {
oprot.writeI64(struct.size);
}
if (struct.isSetFormat_size()) {
oprot.writeString(struct.format_size);
}
if (struct.isSetPercent()) {
oprot.writeByte(struct.percent);
}
if (struct.isSetStatus()) {
oprot.writeI32(struct.status.getValue());
}
if (struct.isSetStatusmsg()) {
oprot.writeString(struct.statusmsg);
}
if (struct.isSetFormat_wait()) {
oprot.writeString(struct.format_wait);
}
if (struct.isSetWait_until()) {
oprot.writeI64(struct.wait_until);
}
if (struct.isSetPackageID()) {
oprot.writeI32(struct.packageID);
}
if (struct.isSetPackageName()) {
oprot.writeString(struct.packageName);
}
if (struct.isSetPlugin()) {
oprot.writeString(struct.plugin);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, DownloadInfo struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(16);
if (incoming.get(0)) {
struct.fid = iprot.readI32();
struct.setFidIsSet(true);
}
if (incoming.get(1)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
}
if (incoming.get(2)) {
struct.speed = iprot.readI64();
struct.setSpeedIsSet(true);
}
if (incoming.get(3)) {
struct.eta = iprot.readI32();
struct.setEtaIsSet(true);
}
if (incoming.get(4)) {
struct.format_eta = iprot.readString();
struct.setFormat_etaIsSet(true);
}
if (incoming.get(5)) {
struct.bleft = iprot.readI64();
struct.setBleftIsSet(true);
}
if (incoming.get(6)) {
struct.size = iprot.readI64();
struct.setSizeIsSet(true);
}
if (incoming.get(7)) {
struct.format_size = iprot.readString();
struct.setFormat_sizeIsSet(true);
}
if (incoming.get(8)) {
struct.percent = iprot.readByte();
struct.setPercentIsSet(true);
}
if (incoming.get(9)) {
struct.status = DownloadStatus.findByValue(iprot.readI32());
struct.setStatusIsSet(true);
}
if (incoming.get(10)) {
struct.statusmsg = iprot.readString();
struct.setStatusmsgIsSet(true);
}
if (incoming.get(11)) {
struct.format_wait = iprot.readString();
struct.setFormat_waitIsSet(true);
}
if (incoming.get(12)) {
struct.wait_until = iprot.readI64();
struct.setWait_untilIsSet(true);
}
if (incoming.get(13)) {
struct.packageID = iprot.readI32();
struct.setPackageIDIsSet(true);
}
if (incoming.get(14)) {
struct.packageName = iprot.readString();
struct.setPackageNameIsSet(true);
}
if (incoming.get(15)) {
struct.plugin = iprot.readString();
struct.setPluginIsSet(true);
}
}
}
}