/**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package server;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Image implements org.apache.thrift.TBase<Image, Image._Fields>, java.io.Serializable, Cloneable, Comparable<Image> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Image");
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1);
private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2);
private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)-3);
private static final org.apache.thrift.protocol.TField LICENSE_RESTRICTION_FIELD_DESC = new org.apache.thrift.protocol.TField("licenseRestriction", org.apache.thrift.protocol.TType.STRING, (short)-4);
private static final org.apache.thrift.protocol.TField OS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("osName", org.apache.thrift.protocol.TType.STRING, (short)-5);
private static final org.apache.thrift.protocol.TField LECTURE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureName", org.apache.thrift.protocol.TType.STRING, (short)-6);
private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.STRING, (short)-7);
private static final org.apache.thrift.protocol.TField USER_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("userData", org.apache.thrift.protocol.TType.STRING, (short)-8);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ImageStandardSchemeFactory());
schemes.put(TupleScheme.class, new ImageTupleSchemeFactory());
}
public String id; // required
public String version; // required
public String imageName; // required
public String licenseRestriction; // required
public String osName; // required
public String lectureName; // required
public String updateTime; // required
public String userData; // 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 {
ID((short)-1, "id"),
VERSION((short)-2, "version"),
IMAGE_NAME((short)-3, "imageName"),
LICENSE_RESTRICTION((short)-4, "licenseRestriction"),
OS_NAME((short)-5, "osName"),
LECTURE_NAME((short)-6, "lectureName"),
UPDATE_TIME((short)-7, "updateTime"),
USER_DATA((short)-8, "userData");
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: // ID
return ID;
case -2: // VERSION
return VERSION;
case -3: // IMAGE_NAME
return IMAGE_NAME;
case -4: // LICENSE_RESTRICTION
return LICENSE_RESTRICTION;
case -5: // OS_NAME
return OS_NAME;
case -6: // LECTURE_NAME
return LECTURE_NAME;
case -7: // UPDATE_TIME
return UPDATE_TIME;
case -8: // USER_DATA
return USER_DATA;
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
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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LICENSE_RESTRICTION, new org.apache.thrift.meta_data.FieldMetaData("licenseRestriction", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.OS_NAME, new org.apache.thrift.meta_data.FieldMetaData("osName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LECTURE_NAME, new org.apache.thrift.meta_data.FieldMetaData("lectureName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_DATA, new org.apache.thrift.meta_data.FieldMetaData("userData", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Image.class, metaDataMap);
}
public Image() {
}
public Image(
String id,
String version,
String imageName,
String licenseRestriction,
String osName,
String lectureName,
String updateTime,
String userData)
{
this();
this.id = id;
this.version = version;
this.imageName = imageName;
this.licenseRestriction = licenseRestriction;
this.osName = osName;
this.lectureName = lectureName;
this.updateTime = updateTime;
this.userData = userData;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Image(Image other) {
if (other.isSetId()) {
this.id = other.id;
}
if (other.isSetVersion()) {
this.version = other.version;
}
if (other.isSetImageName()) {
this.imageName = other.imageName;
}
if (other.isSetLicenseRestriction()) {
this.licenseRestriction = other.licenseRestriction;
}
if (other.isSetOsName()) {
this.osName = other.osName;
}
if (other.isSetLectureName()) {
this.lectureName = other.lectureName;
}
if (other.isSetUpdateTime()) {
this.updateTime = other.updateTime;
}
if (other.isSetUserData()) {
this.userData = other.userData;
}
}
public Image deepCopy() {
return new Image(this);
}
@Override
public void clear() {
this.id = null;
this.version = null;
this.imageName = null;
this.licenseRestriction = null;
this.osName = null;
this.lectureName = null;
this.updateTime = null;
this.userData = null;
}
public String getId() {
return this.id;
}
public Image setId(String id) {
this.id = id;
return this;
}
public void unsetId() {
this.id = null;
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return this.id != null;
}
public void setIdIsSet(boolean value) {
if (!value) {
this.id = null;
}
}
public String getVersion() {
return this.version;
}
public Image setVersion(String version) {
this.version = version;
return this;
}
public void unsetVersion() {
this.version = null;
}
/** Returns true if field version is set (has been assigned a value) and false otherwise */
public boolean isSetVersion() {
return this.version != null;
}
public void setVersionIsSet(boolean value) {
if (!value) {
this.version = null;
}
}
public String getImageName() {
return this.imageName;
}
public Image setImageName(String imageName) {
this.imageName = imageName;
return this;
}
public void unsetImageName() {
this.imageName = null;
}
/** Returns true if field imageName is set (has been assigned a value) and false otherwise */
public boolean isSetImageName() {
return this.imageName != null;
}
public void setImageNameIsSet(boolean value) {
if (!value) {
this.imageName = null;
}
}
public String getLicenseRestriction() {
return this.licenseRestriction;
}
public Image setLicenseRestriction(String licenseRestriction) {
this.licenseRestriction = licenseRestriction;
return this;
}
public void unsetLicenseRestriction() {
this.licenseRestriction = null;
}
/** Returns true if field licenseRestriction is set (has been assigned a value) and false otherwise */
public boolean isSetLicenseRestriction() {
return this.licenseRestriction != null;
}
public void setLicenseRestrictionIsSet(boolean value) {
if (!value) {
this.licenseRestriction = null;
}
}
public String getOsName() {
return this.osName;
}
public Image setOsName(String osName) {
this.osName = osName;
return this;
}
public void unsetOsName() {
this.osName = null;
}
/** Returns true if field osName is set (has been assigned a value) and false otherwise */
public boolean isSetOsName() {
return this.osName != null;
}
public void setOsNameIsSet(boolean value) {
if (!value) {
this.osName = null;
}
}
public String getLectureName() {
return this.lectureName;
}
public Image setLectureName(String lectureName) {
this.lectureName = lectureName;
return this;
}
public void unsetLectureName() {
this.lectureName = null;
}
/** Returns true if field lectureName is set (has been assigned a value) and false otherwise */
public boolean isSetLectureName() {
return this.lectureName != null;
}
public void setLectureNameIsSet(boolean value) {
if (!value) {
this.lectureName = null;
}
}
public String getUpdateTime() {
return this.updateTime;
}
public Image setUpdateTime(String updateTime) {
this.updateTime = updateTime;
return this;
}
public void unsetUpdateTime() {
this.updateTime = null;
}
/** Returns true if field updateTime is set (has been assigned a value) and false otherwise */
public boolean isSetUpdateTime() {
return this.updateTime != null;
}
public void setUpdateTimeIsSet(boolean value) {
if (!value) {
this.updateTime = null;
}
}
public String getUserData() {
return this.userData;
}
public Image setUserData(String userData) {
this.userData = userData;
return this;
}
public void unsetUserData() {
this.userData = null;
}
/** Returns true if field userData is set (has been assigned a value) and false otherwise */
public boolean isSetUserData() {
return this.userData != null;
}
public void setUserDataIsSet(boolean value) {
if (!value) {
this.userData = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
case VERSION:
if (value == null) {
unsetVersion();
} else {
setVersion((String)value);
}
break;
case IMAGE_NAME:
if (value == null) {
unsetImageName();
} else {
setImageName((String)value);
}
break;
case LICENSE_RESTRICTION:
if (value == null) {
unsetLicenseRestriction();
} else {
setLicenseRestriction((String)value);
}
break;
case OS_NAME:
if (value == null) {
unsetOsName();
} else {
setOsName((String)value);
}
break;
case LECTURE_NAME:
if (value == null) {
unsetLectureName();
} else {
setLectureName((String)value);
}
break;
case UPDATE_TIME:
if (value == null) {
unsetUpdateTime();
} else {
setUpdateTime((String)value);
}
break;
case USER_DATA:
if (value == null) {
unsetUserData();
} else {
setUserData((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
case VERSION:
return getVersion();
case IMAGE_NAME:
return getImageName();
case LICENSE_RESTRICTION:
return getLicenseRestriction();
case OS_NAME:
return getOsName();
case LECTURE_NAME:
return getLectureName();
case UPDATE_TIME:
return getUpdateTime();
case USER_DATA:
return getUserData();
}
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 ID:
return isSetId();
case VERSION:
return isSetVersion();
case IMAGE_NAME:
return isSetImageName();
case LICENSE_RESTRICTION:
return isSetLicenseRestriction();
case OS_NAME:
return isSetOsName();
case LECTURE_NAME:
return isSetLectureName();
case UPDATE_TIME:
return isSetUpdateTime();
case USER_DATA:
return isSetUserData();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Image)
return this.equals((Image)that);
return false;
}
public boolean equals(Image that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (!this.id.equals(that.id))
return false;
}
boolean this_present_version = true && this.isSetVersion();
boolean that_present_version = true && that.isSetVersion();
if (this_present_version || that_present_version) {
if (!(this_present_version && that_present_version))
return false;
if (!this.version.equals(that.version))
return false;
}
boolean this_present_imageName = true && this.isSetImageName();
boolean that_present_imageName = true && that.isSetImageName();
if (this_present_imageName || that_present_imageName) {
if (!(this_present_imageName && that_present_imageName))
return false;
if (!this.imageName.equals(that.imageName))
return false;
}
boolean this_present_licenseRestriction = true && this.isSetLicenseRestriction();
boolean that_present_licenseRestriction = true && that.isSetLicenseRestriction();
if (this_present_licenseRestriction || that_present_licenseRestriction) {
if (!(this_present_licenseRestriction && that_present_licenseRestriction))
return false;
if (!this.licenseRestriction.equals(that.licenseRestriction))
return false;
}
boolean this_present_osName = true && this.isSetOsName();
boolean that_present_osName = true && that.isSetOsName();
if (this_present_osName || that_present_osName) {
if (!(this_present_osName && that_present_osName))
return false;
if (!this.osName.equals(that.osName))
return false;
}
boolean this_present_lectureName = true && this.isSetLectureName();
boolean that_present_lectureName = true && that.isSetLectureName();
if (this_present_lectureName || that_present_lectureName) {
if (!(this_present_lectureName && that_present_lectureName))
return false;
if (!this.lectureName.equals(that.lectureName))
return false;
}
boolean this_present_updateTime = true && this.isSetUpdateTime();
boolean that_present_updateTime = true && that.isSetUpdateTime();
if (this_present_updateTime || that_present_updateTime) {
if (!(this_present_updateTime && that_present_updateTime))
return false;
if (!this.updateTime.equals(that.updateTime))
return false;
}
boolean this_present_userData = true && this.isSetUserData();
boolean that_present_userData = true && that.isSetUserData();
if (this_present_userData || that_present_userData) {
if (!(this_present_userData && that_present_userData))
return false;
if (!this.userData.equals(that.userData))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(Image other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetImageName()).compareTo(other.isSetImageName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetImageName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, other.imageName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetLicenseRestriction()).compareTo(other.isSetLicenseRestriction());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetLicenseRestriction()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.licenseRestriction, other.licenseRestriction);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOsName()).compareTo(other.isSetOsName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOsName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.osName, other.osName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetLectureName()).compareTo(other.isSetLectureName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetLectureName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureName, other.lectureName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUpdateTime()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUserData()).compareTo(other.isSetUserData());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserData()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userData, other.userData);
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("Image(");
boolean first = true;
sb.append("id:");
if (this.id == null) {
sb.append("null");
} else {
sb.append(this.id);
}
first = false;
if (!first) sb.append(", ");
sb.append("version:");
if (this.version == null) {
sb.append("null");
} else {
sb.append(this.version);
}
first = false;
if (!first) sb.append(", ");
sb.append("imageName:");
if (this.imageName == null) {
sb.append("null");
} else {
sb.append(this.imageName);
}
first = false;
if (!first) sb.append(", ");
sb.append("licenseRestriction:");
if (this.licenseRestriction == null) {
sb.append("null");
} else {
sb.append(this.licenseRestriction);
}
first = false;
if (!first) sb.append(", ");
sb.append("osName:");
if (this.osName == null) {
sb.append("null");
} else {
sb.append(this.osName);
}
first = false;
if (!first) sb.append(", ");
sb.append("lectureName:");
if (this.lectureName == null) {
sb.append("null");
} else {
sb.append(this.lectureName);
}
first = false;
if (!first) sb.append(", ");
sb.append("updateTime:");
if (this.updateTime == null) {
sb.append("null");
} else {
sb.append(this.updateTime);
}
first = false;
if (!first) sb.append(", ");
sb.append("userData:");
if (this.userData == null) {
sb.append("null");
} else {
sb.append(this.userData);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
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 {
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 ImageStandardSchemeFactory implements SchemeFactory {
public ImageStandardScheme getScheme() {
return new ImageStandardScheme();
}
}
private static class ImageStandardScheme extends StandardScheme<Image> {
public void read(org.apache.thrift.protocol.TProtocol iprot, Image 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: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -2: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -3: // IMAGE_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.imageName = iprot.readString();
struct.setImageNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -4: // LICENSE_RESTRICTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.licenseRestriction = iprot.readString();
struct.setLicenseRestrictionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -5: // OS_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.osName = iprot.readString();
struct.setOsNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -6: // LECTURE_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.lectureName = iprot.readString();
struct.setLectureNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -7: // UPDATE_TIME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.updateTime = iprot.readString();
struct.setUpdateTimeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case -8: // USER_DATA
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.userData = iprot.readString();
struct.setUserDataIsSet(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, Image struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.userData != null) {
oprot.writeFieldBegin(USER_DATA_FIELD_DESC);
oprot.writeString(struct.userData);
oprot.writeFieldEnd();
}
if (struct.updateTime != null) {
oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC);
oprot.writeString(struct.updateTime);
oprot.writeFieldEnd();
}
if (struct.lectureName != null) {
oprot.writeFieldBegin(LECTURE_NAME_FIELD_DESC);
oprot.writeString(struct.lectureName);
oprot.writeFieldEnd();
}
if (struct.osName != null) {
oprot.writeFieldBegin(OS_NAME_FIELD_DESC);
oprot.writeString(struct.osName);
oprot.writeFieldEnd();
}
if (struct.licenseRestriction != null) {
oprot.writeFieldBegin(LICENSE_RESTRICTION_FIELD_DESC);
oprot.writeString(struct.licenseRestriction);
oprot.writeFieldEnd();
}
if (struct.imageName != null) {
oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC);
oprot.writeString(struct.imageName);
oprot.writeFieldEnd();
}
if (struct.version != null) {
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeString(struct.version);
oprot.writeFieldEnd();
}
if (struct.id != null) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeString(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ImageTupleSchemeFactory implements SchemeFactory {
public ImageTupleScheme getScheme() {
return new ImageTupleScheme();
}
}
private static class ImageTupleScheme extends TupleScheme<Image> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetId()) {
optionals.set(0);
}
if (struct.isSetVersion()) {
optionals.set(1);
}
if (struct.isSetImageName()) {
optionals.set(2);
}
if (struct.isSetLicenseRestriction()) {
optionals.set(3);
}
if (struct.isSetOsName()) {
optionals.set(4);
}
if (struct.isSetLectureName()) {
optionals.set(5);
}
if (struct.isSetUpdateTime()) {
optionals.set(6);
}
if (struct.isSetUserData()) {
optionals.set(7);
}
oprot.writeBitSet(optionals, 8);
if (struct.isSetId()) {
oprot.writeString(struct.id);
}
if (struct.isSetVersion()) {
oprot.writeString(struct.version);
}
if (struct.isSetImageName()) {
oprot.writeString(struct.imageName);
}
if (struct.isSetLicenseRestriction()) {
oprot.writeString(struct.licenseRestriction);
}
if (struct.isSetOsName()) {
oprot.writeString(struct.osName);
}
if (struct.isSetLectureName()) {
oprot.writeString(struct.lectureName);
}
if (struct.isSetUpdateTime()) {
oprot.writeString(struct.updateTime);
}
if (struct.isSetUserData()) {
oprot.writeString(struct.userData);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Image struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(8);
if (incoming.get(0)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
if (incoming.get(1)) {
struct.version = iprot.readString();
struct.setVersionIsSet(true);
}
if (incoming.get(2)) {
struct.imageName = iprot.readString();
struct.setImageNameIsSet(true);
}
if (incoming.get(3)) {
struct.licenseRestriction = iprot.readString();
struct.setLicenseRestrictionIsSet(true);
}
if (incoming.get(4)) {
struct.osName = iprot.readString();
struct.setOsNameIsSet(true);
}
if (incoming.get(5)) {
struct.lectureName = iprot.readString();
struct.setLectureNameIsSet(true);
}
if (incoming.get(6)) {
struct.updateTime = iprot.readString();
struct.setUpdateTimeIsSet(true);
}
if (incoming.get(7)) {
struct.userData = iprot.readString();
struct.setUserDataIsSet(true);
}
}
}
}