diff options
author | Simon Rettberg | 2015-06-09 18:57:14 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-06-09 18:57:14 +0200 |
commit | c121d65bb33a42c324b746f6dc5300aee68487dd (patch) | |
tree | fd72496dcf56338af387ff0345636e2d77b6ff86 /src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java | |
parent | Changes for Dozmod v1.1 (diff) | |
download | master-sync-shared-c121d65bb33a42c324b746f6dc5300aee68487dd.tar.gz master-sync-shared-c121d65bb33a42c324b746f6dc5300aee68487dd.tar.xz master-sync-shared-c121d65bb33a42c324b746f6dc5300aee68487dd.zip |
Unified thrift definitions for master and satellite
Diffstat (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java')
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java | 1267 |
1 files changed, 1267 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java b/src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java new file mode 100644 index 0000000..94ed38b --- /dev/null +++ b/src/main/java/org/openslx/bwlp/thrift/iface/LectureWrite.java @@ -0,0 +1,1267 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.openslx.bwlp.thrift.iface; + +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 LectureWrite implements org.apache.thrift.TBase<LectureWrite, LectureWrite._Fields>, java.io.Serializable, Cloneable, Comparable<LectureWrite> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LectureWrite"); + + 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)1); + private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField IMAGE_VERSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageVersionId", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField IS_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("isEnabled", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endTime", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField IS_EXAM_FIELD_DESC = new org.apache.thrift.protocol.TField("isExam", org.apache.thrift.protocol.TType.BOOL, (short)8); + private static final org.apache.thrift.protocol.TField HAS_INTERNET_ACCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasInternetAccess", org.apache.thrift.protocol.TType.BOOL, (short)9); + private static final org.apache.thrift.protocol.TField DEFAULT_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultPermissions", org.apache.thrift.protocol.TType.STRUCT, (short)10); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new LectureWriteStandardSchemeFactory()); + schemes.put(TupleScheme.class, new LectureWriteTupleSchemeFactory()); + } + + public String lectureName; // required + public String description; // required + public String imageVersionId; // required + public boolean isEnabled; // required + public long startTime; // required + public long endTime; // required + public String ownerId; // required + public boolean isExam; // required + public boolean hasInternetAccess; // required + public LecturePermissions defaultPermissions; // 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 { + LECTURE_NAME((short)1, "lectureName"), + DESCRIPTION((short)2, "description"), + IMAGE_VERSION_ID((short)3, "imageVersionId"), + IS_ENABLED((short)4, "isEnabled"), + START_TIME((short)5, "startTime"), + END_TIME((short)6, "endTime"), + OWNER_ID((short)7, "ownerId"), + IS_EXAM((short)8, "isExam"), + HAS_INTERNET_ACCESS((short)9, "hasInternetAccess"), + DEFAULT_PERMISSIONS((short)10, "defaultPermissions"); + + 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: // LECTURE_NAME + return LECTURE_NAME; + case 2: // DESCRIPTION + return DESCRIPTION; + case 3: // IMAGE_VERSION_ID + return IMAGE_VERSION_ID; + case 4: // IS_ENABLED + return IS_ENABLED; + case 5: // START_TIME + return START_TIME; + case 6: // END_TIME + return END_TIME; + case 7: // OWNER_ID + return OWNER_ID; + case 8: // IS_EXAM + return IS_EXAM; + case 9: // HAS_INTERNET_ACCESS + return HAS_INTERNET_ACCESS; + case 10: // DEFAULT_PERMISSIONS + return DEFAULT_PERMISSIONS; + 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 __ISENABLED_ISSET_ID = 0; + private static final int __STARTTIME_ISSET_ID = 1; + private static final int __ENDTIME_ISSET_ID = 2; + private static final int __ISEXAM_ISSET_ID = 3; + private static final int __HASINTERNETACCESS_ISSET_ID = 4; + private byte __isset_bitfield = 0; + 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.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.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGE_VERSION_ID, new org.apache.thrift.meta_data.FieldMetaData("imageVersionId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); + tmpMap.put(_Fields.IS_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("isEnabled", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp"))); + tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("endTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp"))); + tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); + tmpMap.put(_Fields.IS_EXAM, new org.apache.thrift.meta_data.FieldMetaData("isExam", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.HAS_INTERNET_ACCESS, new org.apache.thrift.meta_data.FieldMetaData("hasInternetAccess", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.DEFAULT_PERMISSIONS, new org.apache.thrift.meta_data.FieldMetaData("defaultPermissions", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LecturePermissions.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LectureWrite.class, metaDataMap); + } + + public LectureWrite() { + } + + public LectureWrite( + String lectureName, + String description, + String imageVersionId, + boolean isEnabled, + long startTime, + long endTime, + String ownerId, + boolean isExam, + boolean hasInternetAccess, + LecturePermissions defaultPermissions) + { + this(); + this.lectureName = lectureName; + this.description = description; + this.imageVersionId = imageVersionId; + this.isEnabled = isEnabled; + setIsEnabledIsSet(true); + this.startTime = startTime; + setStartTimeIsSet(true); + this.endTime = endTime; + setEndTimeIsSet(true); + this.ownerId = ownerId; + this.isExam = isExam; + setIsExamIsSet(true); + this.hasInternetAccess = hasInternetAccess; + setHasInternetAccessIsSet(true); + this.defaultPermissions = defaultPermissions; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public LectureWrite(LectureWrite other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetLectureName()) { + this.lectureName = other.lectureName; + } + if (other.isSetDescription()) { + this.description = other.description; + } + if (other.isSetImageVersionId()) { + this.imageVersionId = other.imageVersionId; + } + this.isEnabled = other.isEnabled; + this.startTime = other.startTime; + this.endTime = other.endTime; + if (other.isSetOwnerId()) { + this.ownerId = other.ownerId; + } + this.isExam = other.isExam; + this.hasInternetAccess = other.hasInternetAccess; + if (other.isSetDefaultPermissions()) { + this.defaultPermissions = new LecturePermissions(other.defaultPermissions); + } + } + + public LectureWrite deepCopy() { + return new LectureWrite(this); + } + + @Override + public void clear() { + this.lectureName = null; + this.description = null; + this.imageVersionId = null; + setIsEnabledIsSet(false); + this.isEnabled = false; + setStartTimeIsSet(false); + this.startTime = 0; + setEndTimeIsSet(false); + this.endTime = 0; + this.ownerId = null; + setIsExamIsSet(false); + this.isExam = false; + setHasInternetAccessIsSet(false); + this.hasInternetAccess = false; + this.defaultPermissions = null; + } + + public String getLectureName() { + return this.lectureName; + } + + public LectureWrite 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 getDescription() { + return this.description; + } + + public LectureWrite setDescription(String description) { + this.description = description; + return this; + } + + public void unsetDescription() { + this.description = null; + } + + /** Returns true if field description is set (has been assigned a value) and false otherwise */ + public boolean isSetDescription() { + return this.description != null; + } + + public void setDescriptionIsSet(boolean value) { + if (!value) { + this.description = null; + } + } + + public String getImageVersionId() { + return this.imageVersionId; + } + + public LectureWrite setImageVersionId(String imageVersionId) { + this.imageVersionId = imageVersionId; + return this; + } + + public void unsetImageVersionId() { + this.imageVersionId = null; + } + + /** Returns true if field imageVersionId is set (has been assigned a value) and false otherwise */ + public boolean isSetImageVersionId() { + return this.imageVersionId != null; + } + + public void setImageVersionIdIsSet(boolean value) { + if (!value) { + this.imageVersionId = null; + } + } + + public boolean isIsEnabled() { + return this.isEnabled; + } + + public LectureWrite setIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + setIsEnabledIsSet(true); + return this; + } + + public void unsetIsEnabled() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISENABLED_ISSET_ID); + } + + /** Returns true if field isEnabled is set (has been assigned a value) and false otherwise */ + public boolean isSetIsEnabled() { + return EncodingUtils.testBit(__isset_bitfield, __ISENABLED_ISSET_ID); + } + + public void setIsEnabledIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISENABLED_ISSET_ID, value); + } + + public long getStartTime() { + return this.startTime; + } + + public LectureWrite setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + return this; + } + + public void unsetStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + } + + public long getEndTime() { + return this.endTime; + } + + public LectureWrite setEndTime(long endTime) { + this.endTime = endTime; + setEndTimeIsSet(true); + return this; + } + + public void unsetEndTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID); + } + + /** Returns true if field endTime is set (has been assigned a value) and false otherwise */ + public boolean isSetEndTime() { + return EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID); + } + + public void setEndTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value); + } + + public String getOwnerId() { + return this.ownerId; + } + + public LectureWrite setOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + public void unsetOwnerId() { + this.ownerId = null; + } + + /** Returns true if field ownerId is set (has been assigned a value) and false otherwise */ + public boolean isSetOwnerId() { + return this.ownerId != null; + } + + public void setOwnerIdIsSet(boolean value) { + if (!value) { + this.ownerId = null; + } + } + + public boolean isIsExam() { + return this.isExam; + } + + public LectureWrite setIsExam(boolean isExam) { + this.isExam = isExam; + setIsExamIsSet(true); + return this; + } + + public void unsetIsExam() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISEXAM_ISSET_ID); + } + + /** Returns true if field isExam is set (has been assigned a value) and false otherwise */ + public boolean isSetIsExam() { + return EncodingUtils.testBit(__isset_bitfield, __ISEXAM_ISSET_ID); + } + + public void setIsExamIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISEXAM_ISSET_ID, value); + } + + public boolean isHasInternetAccess() { + return this.hasInternetAccess; + } + + public LectureWrite setHasInternetAccess(boolean hasInternetAccess) { + this.hasInternetAccess = hasInternetAccess; + setHasInternetAccessIsSet(true); + return this; + } + + public void unsetHasInternetAccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASINTERNETACCESS_ISSET_ID); + } + + /** Returns true if field hasInternetAccess is set (has been assigned a value) and false otherwise */ + public boolean isSetHasInternetAccess() { + return EncodingUtils.testBit(__isset_bitfield, __HASINTERNETACCESS_ISSET_ID); + } + + public void setHasInternetAccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASINTERNETACCESS_ISSET_ID, value); + } + + public LecturePermissions getDefaultPermissions() { + return this.defaultPermissions; + } + + public LectureWrite setDefaultPermissions(LecturePermissions defaultPermissions) { + this.defaultPermissions = defaultPermissions; + return this; + } + + public void unsetDefaultPermissions() { + this.defaultPermissions = null; + } + + /** Returns true if field defaultPermissions is set (has been assigned a value) and false otherwise */ + public boolean isSetDefaultPermissions() { + return this.defaultPermissions != null; + } + + public void setDefaultPermissionsIsSet(boolean value) { + if (!value) { + this.defaultPermissions = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LECTURE_NAME: + if (value == null) { + unsetLectureName(); + } else { + setLectureName((String)value); + } + break; + + case DESCRIPTION: + if (value == null) { + unsetDescription(); + } else { + setDescription((String)value); + } + break; + + case IMAGE_VERSION_ID: + if (value == null) { + unsetImageVersionId(); + } else { + setImageVersionId((String)value); + } + break; + + case IS_ENABLED: + if (value == null) { + unsetIsEnabled(); + } else { + setIsEnabled((Boolean)value); + } + break; + + case START_TIME: + if (value == null) { + unsetStartTime(); + } else { + setStartTime((Long)value); + } + break; + + case END_TIME: + if (value == null) { + unsetEndTime(); + } else { + setEndTime((Long)value); + } + break; + + case OWNER_ID: + if (value == null) { + unsetOwnerId(); + } else { + setOwnerId((String)value); + } + break; + + case IS_EXAM: + if (value == null) { + unsetIsExam(); + } else { + setIsExam((Boolean)value); + } + break; + + case HAS_INTERNET_ACCESS: + if (value == null) { + unsetHasInternetAccess(); + } else { + setHasInternetAccess((Boolean)value); + } + break; + + case DEFAULT_PERMISSIONS: + if (value == null) { + unsetDefaultPermissions(); + } else { + setDefaultPermissions((LecturePermissions)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LECTURE_NAME: + return getLectureName(); + + case DESCRIPTION: + return getDescription(); + + case IMAGE_VERSION_ID: + return getImageVersionId(); + + case IS_ENABLED: + return Boolean.valueOf(isIsEnabled()); + + case START_TIME: + return Long.valueOf(getStartTime()); + + case END_TIME: + return Long.valueOf(getEndTime()); + + case OWNER_ID: + return getOwnerId(); + + case IS_EXAM: + return Boolean.valueOf(isIsExam()); + + case HAS_INTERNET_ACCESS: + return Boolean.valueOf(isHasInternetAccess()); + + case DEFAULT_PERMISSIONS: + return getDefaultPermissions(); + + } + 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 LECTURE_NAME: + return isSetLectureName(); + case DESCRIPTION: + return isSetDescription(); + case IMAGE_VERSION_ID: + return isSetImageVersionId(); + case IS_ENABLED: + return isSetIsEnabled(); + case START_TIME: + return isSetStartTime(); + case END_TIME: + return isSetEndTime(); + case OWNER_ID: + return isSetOwnerId(); + case IS_EXAM: + return isSetIsExam(); + case HAS_INTERNET_ACCESS: + return isSetHasInternetAccess(); + case DEFAULT_PERMISSIONS: + return isSetDefaultPermissions(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof LectureWrite) + return this.equals((LectureWrite)that); + return false; + } + + public boolean equals(LectureWrite that) { + if (that == null) + 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_description = true && this.isSetDescription(); + boolean that_present_description = true && that.isSetDescription(); + if (this_present_description || that_present_description) { + if (!(this_present_description && that_present_description)) + return false; + if (!this.description.equals(that.description)) + return false; + } + + boolean this_present_imageVersionId = true && this.isSetImageVersionId(); + boolean that_present_imageVersionId = true && that.isSetImageVersionId(); + if (this_present_imageVersionId || that_present_imageVersionId) { + if (!(this_present_imageVersionId && that_present_imageVersionId)) + return false; + if (!this.imageVersionId.equals(that.imageVersionId)) + return false; + } + + boolean this_present_isEnabled = true; + boolean that_present_isEnabled = true; + if (this_present_isEnabled || that_present_isEnabled) { + if (!(this_present_isEnabled && that_present_isEnabled)) + return false; + if (this.isEnabled != that.isEnabled) + return false; + } + + boolean this_present_startTime = true; + boolean that_present_startTime = true; + if (this_present_startTime || that_present_startTime) { + if (!(this_present_startTime && that_present_startTime)) + return false; + if (this.startTime != that.startTime) + return false; + } + + boolean this_present_endTime = true; + boolean that_present_endTime = true; + if (this_present_endTime || that_present_endTime) { + if (!(this_present_endTime && that_present_endTime)) + return false; + if (this.endTime != that.endTime) + return false; + } + + boolean this_present_ownerId = true && this.isSetOwnerId(); + boolean that_present_ownerId = true && that.isSetOwnerId(); + if (this_present_ownerId || that_present_ownerId) { + if (!(this_present_ownerId && that_present_ownerId)) + return false; + if (!this.ownerId.equals(that.ownerId)) + return false; + } + + boolean this_present_isExam = true; + boolean that_present_isExam = true; + if (this_present_isExam || that_present_isExam) { + if (!(this_present_isExam && that_present_isExam)) + return false; + if (this.isExam != that.isExam) + return false; + } + + boolean this_present_hasInternetAccess = true; + boolean that_present_hasInternetAccess = true; + if (this_present_hasInternetAccess || that_present_hasInternetAccess) { + if (!(this_present_hasInternetAccess && that_present_hasInternetAccess)) + return false; + if (this.hasInternetAccess != that.hasInternetAccess) + return false; + } + + boolean this_present_defaultPermissions = true && this.isSetDefaultPermissions(); + boolean that_present_defaultPermissions = true && that.isSetDefaultPermissions(); + if (this_present_defaultPermissions || that_present_defaultPermissions) { + if (!(this_present_defaultPermissions && that_present_defaultPermissions)) + return false; + if (!this.defaultPermissions.equals(that.defaultPermissions)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(LectureWrite other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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(isSetDescription()).compareTo(other.isSetDescription()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDescription()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageVersionId()).compareTo(other.isSetImageVersionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageVersionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageVersionId, other.imageVersionId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsEnabled()).compareTo(other.isSetIsEnabled()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsEnabled()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isEnabled, other.isEnabled); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndTime()).compareTo(other.isSetEndTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endTime, other.endTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOwnerId()).compareTo(other.isSetOwnerId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOwnerId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerId, other.ownerId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsExam()).compareTo(other.isSetIsExam()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsExam()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isExam, other.isExam); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHasInternetAccess()).compareTo(other.isSetHasInternetAccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasInternetAccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasInternetAccess, other.hasInternetAccess); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDefaultPermissions()).compareTo(other.isSetDefaultPermissions()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDefaultPermissions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultPermissions, other.defaultPermissions); + 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("LectureWrite("); + boolean first = true; + + sb.append("lectureName:"); + if (this.lectureName == null) { + sb.append("null"); + } else { + sb.append(this.lectureName); + } + first = false; + if (!first) sb.append(", "); + sb.append("description:"); + if (this.description == null) { + sb.append("null"); + } else { + sb.append(this.description); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageVersionId:"); + if (this.imageVersionId == null) { + sb.append("null"); + } else { + sb.append(this.imageVersionId); + } + first = false; + if (!first) sb.append(", "); + sb.append("isEnabled:"); + sb.append(this.isEnabled); + first = false; + if (!first) sb.append(", "); + sb.append("startTime:"); + sb.append(this.startTime); + first = false; + if (!first) sb.append(", "); + sb.append("endTime:"); + sb.append(this.endTime); + first = false; + if (!first) sb.append(", "); + sb.append("ownerId:"); + if (this.ownerId == null) { + sb.append("null"); + } else { + sb.append(this.ownerId); + } + first = false; + if (!first) sb.append(", "); + sb.append("isExam:"); + sb.append(this.isExam); + first = false; + if (!first) sb.append(", "); + sb.append("hasInternetAccess:"); + sb.append(this.hasInternetAccess); + first = false; + if (!first) sb.append(", "); + sb.append("defaultPermissions:"); + if (this.defaultPermissions == null) { + sb.append("null"); + } else { + sb.append(this.defaultPermissions); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (defaultPermissions != null) { + defaultPermissions.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class LectureWriteStandardSchemeFactory implements SchemeFactory { + public LectureWriteStandardScheme getScheme() { + return new LectureWriteStandardScheme(); + } + } + + private static class LectureWriteStandardScheme extends StandardScheme<LectureWrite> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, LectureWrite 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: // 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 2: // DESCRIPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // IMAGE_VERSION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageVersionId = iprot.readString(); + struct.setImageVersionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // IS_ENABLED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isEnabled = iprot.readBool(); + struct.setIsEnabledIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // END_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.endTime = iprot.readI64(); + struct.setEndTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // OWNER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ownerId = iprot.readString(); + struct.setOwnerIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // IS_EXAM + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isExam = iprot.readBool(); + struct.setIsExamIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // HAS_INTERNET_ACCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasInternetAccess = iprot.readBool(); + struct.setHasInternetAccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // DEFAULT_PERMISSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.defaultPermissions = new LecturePermissions(); + struct.defaultPermissions.read(iprot); + struct.setDefaultPermissionsIsSet(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, LectureWrite struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.lectureName != null) { + oprot.writeFieldBegin(LECTURE_NAME_FIELD_DESC); + oprot.writeString(struct.lectureName); + oprot.writeFieldEnd(); + } + if (struct.description != null) { + oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.description); + oprot.writeFieldEnd(); + } + if (struct.imageVersionId != null) { + oprot.writeFieldBegin(IMAGE_VERSION_ID_FIELD_DESC); + oprot.writeString(struct.imageVersionId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ENABLED_FIELD_DESC); + oprot.writeBool(struct.isEnabled); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(START_TIME_FIELD_DESC); + oprot.writeI64(struct.startTime); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(END_TIME_FIELD_DESC); + oprot.writeI64(struct.endTime); + oprot.writeFieldEnd(); + if (struct.ownerId != null) { + oprot.writeFieldBegin(OWNER_ID_FIELD_DESC); + oprot.writeString(struct.ownerId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_EXAM_FIELD_DESC); + oprot.writeBool(struct.isExam); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(HAS_INTERNET_ACCESS_FIELD_DESC); + oprot.writeBool(struct.hasInternetAccess); + oprot.writeFieldEnd(); + if (struct.defaultPermissions != null) { + oprot.writeFieldBegin(DEFAULT_PERMISSIONS_FIELD_DESC); + struct.defaultPermissions.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class LectureWriteTupleSchemeFactory implements SchemeFactory { + public LectureWriteTupleScheme getScheme() { + return new LectureWriteTupleScheme(); + } + } + + private static class LectureWriteTupleScheme extends TupleScheme<LectureWrite> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, LectureWrite struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLectureName()) { + optionals.set(0); + } + if (struct.isSetDescription()) { + optionals.set(1); + } + if (struct.isSetImageVersionId()) { + optionals.set(2); + } + if (struct.isSetIsEnabled()) { + optionals.set(3); + } + if (struct.isSetStartTime()) { + optionals.set(4); + } + if (struct.isSetEndTime()) { + optionals.set(5); + } + if (struct.isSetOwnerId()) { + optionals.set(6); + } + if (struct.isSetIsExam()) { + optionals.set(7); + } + if (struct.isSetHasInternetAccess()) { + optionals.set(8); + } + if (struct.isSetDefaultPermissions()) { + optionals.set(9); + } + oprot.writeBitSet(optionals, 10); + if (struct.isSetLectureName()) { + oprot.writeString(struct.lectureName); + } + if (struct.isSetDescription()) { + oprot.writeString(struct.description); + } + if (struct.isSetImageVersionId()) { + oprot.writeString(struct.imageVersionId); + } + if (struct.isSetIsEnabled()) { + oprot.writeBool(struct.isEnabled); + } + if (struct.isSetStartTime()) { + oprot.writeI64(struct.startTime); + } + if (struct.isSetEndTime()) { + oprot.writeI64(struct.endTime); + } + if (struct.isSetOwnerId()) { + oprot.writeString(struct.ownerId); + } + if (struct.isSetIsExam()) { + oprot.writeBool(struct.isExam); + } + if (struct.isSetHasInternetAccess()) { + oprot.writeBool(struct.hasInternetAccess); + } + if (struct.isSetDefaultPermissions()) { + struct.defaultPermissions.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, LectureWrite struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(10); + if (incoming.get(0)) { + struct.lectureName = iprot.readString(); + struct.setLectureNameIsSet(true); + } + if (incoming.get(1)) { + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); + } + if (incoming.get(2)) { + struct.imageVersionId = iprot.readString(); + struct.setImageVersionIdIsSet(true); + } + if (incoming.get(3)) { + struct.isEnabled = iprot.readBool(); + struct.setIsEnabledIsSet(true); + } + if (incoming.get(4)) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + if (incoming.get(5)) { + struct.endTime = iprot.readI64(); + struct.setEndTimeIsSet(true); + } + if (incoming.get(6)) { + struct.ownerId = iprot.readString(); + struct.setOwnerIdIsSet(true); + } + if (incoming.get(7)) { + struct.isExam = iprot.readBool(); + struct.setIsExamIsSet(true); + } + if (incoming.get(8)) { + struct.hasInternetAccess = iprot.readBool(); + struct.setHasInternetAccessIsSet(true); + } + if (incoming.get(9)) { + struct.defaultPermissions = new LecturePermissions(); + struct.defaultPermissions.read(iprot); + struct.setDefaultPermissionsIsSet(true); + } + } + } + +} + |