/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package com.dgrid.gen; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; import com.facebook.thrift.*; import com.facebook.thrift.protocol.*; import com.facebook.thrift.transport.*; public class Job implements TBase, java.io.Serializable { private int id; private long timeCreated; private String submitter; private String description; private List<Joblet> joblets; private int callbackType; private String callbackAddress; private String callbackContent; private int status; public final Isset __isset = new Isset(); public static final class Isset implements java.io.Serializable { public boolean id = false; public boolean timeCreated = false; public boolean submitter = false; public boolean description = false; public boolean joblets = false; public boolean callbackType = false; public boolean callbackAddress = false; public boolean callbackContent = false; public boolean status = false; } public Job() { } public Job( int id, long timeCreated, String submitter, String description, List<Joblet> joblets, int callbackType, String callbackAddress, String callbackContent, int status) { this(); this.id = id; this.__isset.id = true; this.timeCreated = timeCreated; this.__isset.timeCreated = true; this.submitter = submitter; this.__isset.submitter = true; this.description = description; this.__isset.description = true; this.joblets = joblets; this.__isset.joblets = true; this.callbackType = callbackType; this.__isset.callbackType = true; this.callbackAddress = callbackAddress; this.__isset.callbackAddress = true; this.callbackContent = callbackContent; this.__isset.callbackContent = true; this.status = status; this.__isset.status = true; } public int getId() { return this.id; } public void setId(int id) { this.id = id; this.__isset.id = true; } public void unsetId() { this.__isset.id = false; } public long getTimeCreated() { return this.timeCreated; } public void setTimeCreated(long timeCreated) { this.timeCreated = timeCreated; this.__isset.timeCreated = true; } public void unsetTimeCreated() { this.__isset.timeCreated = false; } public String getSubmitter() { return this.submitter; } public void setSubmitter(String submitter) { this.submitter = submitter; this.__isset.submitter = true; } public void unsetSubmitter() { this.__isset.submitter = false; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; this.__isset.description = true; } public void unsetDescription() { this.__isset.description = false; } public int getJobletsSize() { return (this.joblets == null) ? 0 : this.joblets.size(); } public java.util.Iterator<Joblet> getJobletsIterator() { return (this.joblets == null) ? null : this.joblets.iterator(); } public void addToJoblets(Joblet elem) { if (this.joblets == null) { this.joblets = new ArrayList<Joblet>(); } this.joblets.add(elem); this.__isset.joblets = true; } public List<Joblet> getJoblets() { return this.joblets; } public void setJoblets(List<Joblet> joblets) { this.joblets = joblets; this.__isset.joblets = true; } public void unsetJoblets() { this.joblets = null; this.__isset.joblets = false; } public int getCallbackType() { return this.callbackType; } public void setCallbackType(int callbackType) { this.callbackType = callbackType; this.__isset.callbackType = true; } public void unsetCallbackType() { this.__isset.callbackType = false; } public String getCallbackAddress() { return this.callbackAddress; } public void setCallbackAddress(String callbackAddress) { this.callbackAddress = callbackAddress; this.__isset.callbackAddress = true; } public void unsetCallbackAddress() { this.__isset.callbackAddress = false; } public String getCallbackContent() { return this.callbackContent; } public void setCallbackContent(String callbackContent) { this.callbackContent = callbackContent; this.__isset.callbackContent = true; } public void unsetCallbackContent() { this.__isset.callbackContent = false; } public int getStatus() { return this.status; } public void setStatus(int status) { this.status = status; this.__isset.status = true; } public void unsetStatus() { this.__isset.status = false; } public boolean equals(Object that) { if (that == null) return false; if (that instanceof Job) return this.equals((Job)that); return false; } public boolean equals(Job that) { if (that == null) return false; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_timeCreated = true; boolean that_present_timeCreated = true; if (this_present_timeCreated || that_present_timeCreated) { if (!(this_present_timeCreated && that_present_timeCreated)) return false; if (this.timeCreated != that.timeCreated) return false; } boolean this_present_submitter = true && (this.submitter != null); boolean that_present_submitter = true && (that.submitter != null); if (this_present_submitter || that_present_submitter) { if (!(this_present_submitter && that_present_submitter)) return false; if (!this.submitter.equals(that.submitter)) return false; } boolean this_present_description = true && (this.description != null); boolean that_present_description = true && (that.description != null); 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_joblets = true && (this.joblets != null); boolean that_present_joblets = true && (that.joblets != null); if (this_present_joblets || that_present_joblets) { if (!(this_present_joblets && that_present_joblets)) return false; if (!this.joblets.equals(that.joblets)) return false; } boolean this_present_callbackType = true; boolean that_present_callbackType = true; if (this_present_callbackType || that_present_callbackType) { if (!(this_present_callbackType && that_present_callbackType)) return false; if (this.callbackType != that.callbackType) return false; } boolean this_present_callbackAddress = true && (this.callbackAddress != null); boolean that_present_callbackAddress = true && (that.callbackAddress != null); if (this_present_callbackAddress || that_present_callbackAddress) { if (!(this_present_callbackAddress && that_present_callbackAddress)) return false; if (!this.callbackAddress.equals(that.callbackAddress)) return false; } boolean this_present_callbackContent = true && (this.callbackContent != null); boolean that_present_callbackContent = true && (that.callbackContent != null); if (this_present_callbackContent || that_present_callbackContent) { if (!(this_present_callbackContent && that_present_callbackContent)) return false; if (!this.callbackContent.equals(that.callbackContent)) return false; } boolean this_present_status = true; boolean that_present_status = true; if (this_present_status || that_present_status) { if (!(this_present_status && that_present_status)) return false; if (this.status != that.status) return false; } return true; } public int hashCode() { return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: if (field.type == TType.I32) { this.id = iprot.readI32(); this.__isset.id = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: if (field.type == TType.I64) { this.timeCreated = iprot.readI64(); this.__isset.timeCreated = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 3: if (field.type == TType.STRING) { this.submitter = iprot.readString(); this.__isset.submitter = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 4: if (field.type == TType.STRING) { this.description = iprot.readString(); this.__isset.description = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 5: if (field.type == TType.LIST) { { TList _list10 = iprot.readListBegin(); this.joblets = new ArrayList<Joblet>(_list10.size); for (int _i11 = 0; _i11 < _list10.size; ++_i11) { Joblet _elem12 = new Joblet(); _elem12 = new Joblet(); _elem12.read(iprot); this.joblets.add(_elem12); } iprot.readListEnd(); } this.__isset.joblets = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 6: if (field.type == TType.I32) { this.callbackType = iprot.readI32(); this.__isset.callbackType = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 7: if (field.type == TType.STRING) { this.callbackAddress = iprot.readString(); this.__isset.callbackAddress = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 8: if (field.type == TType.STRING) { this.callbackContent = iprot.readString(); this.__isset.callbackContent = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case 9: if (field.type == TType.I32) { this.status = iprot.readI32(); this.__isset.status = true; } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); } public void write(TProtocol oprot) throws TException { TStruct struct = new TStruct("Job"); oprot.writeStructBegin(struct); TField field = new TField(); field.name = "id"; field.type = TType.I32; field.id = 1; oprot.writeFieldBegin(field); oprot.writeI32(this.id); oprot.writeFieldEnd(); field.name = "timeCreated"; field.type = TType.I64; field.id = 2; oprot.writeFieldBegin(field); oprot.writeI64(this.timeCreated); oprot.writeFieldEnd(); if (this.submitter != null) { field.name = "submitter"; field.type = TType.STRING; field.id = 3; oprot.writeFieldBegin(field); oprot.writeString(this.submitter); oprot.writeFieldEnd(); } if (this.description != null) { field.name = "description"; field.type = TType.STRING; field.id = 4; oprot.writeFieldBegin(field); oprot.writeString(this.description); oprot.writeFieldEnd(); } if (this.joblets != null) { field.name = "joblets"; field.type = TType.LIST; field.id = 5; oprot.writeFieldBegin(field); { oprot.writeListBegin(new TList(TType.STRUCT, this.joblets.size())); for (Joblet _iter13 : this.joblets) { _iter13.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } field.name = "callbackType"; field.type = TType.I32; field.id = 6; oprot.writeFieldBegin(field); oprot.writeI32(this.callbackType); oprot.writeFieldEnd(); if (this.callbackAddress != null) { field.name = "callbackAddress"; field.type = TType.STRING; field.id = 7; oprot.writeFieldBegin(field); oprot.writeString(this.callbackAddress); oprot.writeFieldEnd(); } if (this.callbackContent != null) { field.name = "callbackContent"; field.type = TType.STRING; field.id = 8; oprot.writeFieldBegin(field); oprot.writeString(this.callbackContent); oprot.writeFieldEnd(); } field.name = "status"; field.type = TType.I32; field.id = 9; oprot.writeFieldBegin(field); oprot.writeI32(this.status); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } public String toString() { StringBuilder sb = new StringBuilder("Job("); sb.append("id:"); sb.append(this.id); sb.append(",timeCreated:"); sb.append(this.timeCreated); sb.append(",submitter:"); sb.append(this.submitter); sb.append(",description:"); sb.append(this.description); sb.append(",joblets:"); sb.append(this.joblets); sb.append(",callbackType:"); sb.append(this.callbackType); sb.append(",callbackAddress:"); sb.append(this.callbackAddress); sb.append(",callbackContent:"); sb.append(this.callbackContent); sb.append(",status:"); sb.append(this.status); sb.append(")"); return sb.toString(); } }