/**
* 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 Joblet implements TBase, java.io.Serializable {
private int id;
private long timeCreated;
private int jobId;
private int hostId;
private String submitter;
private int priority;
private String jobletType;
private String description;
private Map<String,String> parameters;
private String content;
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 jobId = false;
public boolean hostId = false;
public boolean submitter = false;
public boolean priority = false;
public boolean jobletType = false;
public boolean description = false;
public boolean parameters = false;
public boolean content = false;
public boolean status = false;
}
public Joblet() {
}
public Joblet(
int id,
long timeCreated,
int jobId,
int hostId,
String submitter,
int priority,
String jobletType,
String description,
Map<String,String> parameters,
String content,
int status)
{
this();
this.id = id;
this.__isset.id = true;
this.timeCreated = timeCreated;
this.__isset.timeCreated = true;
this.jobId = jobId;
this.__isset.jobId = true;
this.hostId = hostId;
this.__isset.hostId = true;
this.submitter = submitter;
this.__isset.submitter = true;
this.priority = priority;
this.__isset.priority = true;
this.jobletType = jobletType;
this.__isset.jobletType = true;
this.description = description;
this.__isset.description = true;
this.parameters = parameters;
this.__isset.parameters = true;
this.content = content;
this.__isset.content = 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 int getJobId() {
return this.jobId;
}
public void setJobId(int jobId) {
this.jobId = jobId;
this.__isset.jobId = true;
}
public void unsetJobId() {
this.__isset.jobId = false;
}
public int getHostId() {
return this.hostId;
}
public void setHostId(int hostId) {
this.hostId = hostId;
this.__isset.hostId = true;
}
public void unsetHostId() {
this.__isset.hostId = 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 int getPriority() {
return this.priority;
}
public void setPriority(int priority) {
this.priority = priority;
this.__isset.priority = true;
}
public void unsetPriority() {
this.__isset.priority = false;
}
public String getJobletType() {
return this.jobletType;
}
public void setJobletType(String jobletType) {
this.jobletType = jobletType;
this.__isset.jobletType = true;
}
public void unsetJobletType() {
this.__isset.jobletType = 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 getParametersSize() {
return (this.parameters == null) ? 0 : this.parameters.size();
}
public void putToParameters(String key, String val) {
if (this.parameters == null) {
this.parameters = new HashMap<String,String>();
}
this.parameters.put(key, val);
this.__isset.parameters = true;
}
public Map<String,String> getParameters() {
return this.parameters;
}
public void setParameters(Map<String,String> parameters) {
this.parameters = parameters;
this.__isset.parameters = true;
}
public void unsetParameters() {
this.parameters = null;
this.__isset.parameters = false;
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
this.__isset.content = true;
}
public void unsetContent() {
this.__isset.content = 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 Joblet)
return this.equals((Joblet)that);
return false;
}
public boolean equals(Joblet 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_jobId = true;
boolean that_present_jobId = true;
if (this_present_jobId || that_present_jobId) {
if (!(this_present_jobId && that_present_jobId))
return false;
if (this.jobId != that.jobId)
return false;
}
boolean this_present_hostId = true;
boolean that_present_hostId = true;
if (this_present_hostId || that_present_hostId) {
if (!(this_present_hostId && that_present_hostId))
return false;
if (this.hostId != that.hostId)
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_priority = true;
boolean that_present_priority = true;
if (this_present_priority || that_present_priority) {
if (!(this_present_priority && that_present_priority))
return false;
if (this.priority != that.priority)
return false;
}
boolean this_present_jobletType = true && (this.jobletType != null);
boolean that_present_jobletType = true && (that.jobletType != null);
if (this_present_jobletType || that_present_jobletType) {
if (!(this_present_jobletType && that_present_jobletType))
return false;
if (!this.jobletType.equals(that.jobletType))
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_parameters = true && (this.parameters != null);
boolean that_present_parameters = true && (that.parameters != null);
if (this_present_parameters || that_present_parameters) {
if (!(this_present_parameters && that_present_parameters))
return false;
if (!this.parameters.equals(that.parameters))
return false;
}
boolean this_present_content = true && (this.content != null);
boolean that_present_content = true && (that.content != null);
if (this_present_content || that_present_content) {
if (!(this_present_content && that_present_content))
return false;
if (!this.content.equals(that.content))
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.I32) {
this.jobId = iprot.readI32();
this.__isset.jobId = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4:
if (field.type == TType.I32) {
this.hostId = iprot.readI32();
this.__isset.hostId = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5:
if (field.type == TType.STRING) {
this.submitter = iprot.readString();
this.__isset.submitter = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6:
if (field.type == TType.I32) {
this.priority = iprot.readI32();
this.__isset.priority = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7:
if (field.type == TType.STRING) {
this.jobletType = iprot.readString();
this.__isset.jobletType = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 8:
if (field.type == TType.STRING) {
this.description = iprot.readString();
this.__isset.description = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 9:
if (field.type == TType.MAP) {
{
TMap _map5 = iprot.readMapBegin();
this.parameters = new HashMap<String,String>(2*_map5.size);
for (int _i6 = 0; _i6 < _map5.size; ++_i6)
{
String _key7;
String _val8;
_key7 = iprot.readString();
_val8 = iprot.readString();
this.parameters.put(_key7, _val8);
}
iprot.readMapEnd();
}
this.__isset.parameters = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 10:
if (field.type == TType.STRING) {
this.content = iprot.readString();
this.__isset.content = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 11:
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("Joblet");
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();
field.name = "jobId";
field.type = TType.I32;
field.id = 3;
oprot.writeFieldBegin(field);
oprot.writeI32(this.jobId);
oprot.writeFieldEnd();
field.name = "hostId";
field.type = TType.I32;
field.id = 4;
oprot.writeFieldBegin(field);
oprot.writeI32(this.hostId);
oprot.writeFieldEnd();
if (this.submitter != null) {
field.name = "submitter";
field.type = TType.STRING;
field.id = 5;
oprot.writeFieldBegin(field);
oprot.writeString(this.submitter);
oprot.writeFieldEnd();
}
field.name = "priority";
field.type = TType.I32;
field.id = 6;
oprot.writeFieldBegin(field);
oprot.writeI32(this.priority);
oprot.writeFieldEnd();
if (this.jobletType != null) {
field.name = "jobletType";
field.type = TType.STRING;
field.id = 7;
oprot.writeFieldBegin(field);
oprot.writeString(this.jobletType);
oprot.writeFieldEnd();
}
if (this.description != null) {
field.name = "description";
field.type = TType.STRING;
field.id = 8;
oprot.writeFieldBegin(field);
oprot.writeString(this.description);
oprot.writeFieldEnd();
}
if (this.parameters != null) {
field.name = "parameters";
field.type = TType.MAP;
field.id = 9;
oprot.writeFieldBegin(field);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size()));
for (String _iter9 : this.parameters.keySet()) {
oprot.writeString(_iter9);
oprot.writeString(this.parameters.get(_iter9));
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
if (this.content != null) {
field.name = "content";
field.type = TType.STRING;
field.id = 10;
oprot.writeFieldBegin(field);
oprot.writeString(this.content);
oprot.writeFieldEnd();
}
field.name = "status";
field.type = TType.I32;
field.id = 11;
oprot.writeFieldBegin(field);
oprot.writeI32(this.status);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
public String toString() {
StringBuilder sb = new StringBuilder("Joblet(");
sb.append("id:");
sb.append(this.id);
sb.append(",timeCreated:");
sb.append(this.timeCreated);
sb.append(",jobId:");
sb.append(this.jobId);
sb.append(",hostId:");
sb.append(this.hostId);
sb.append(",submitter:");
sb.append(this.submitter);
sb.append(",priority:");
sb.append(this.priority);
sb.append(",jobletType:");
sb.append(this.jobletType);
sb.append(",description:");
sb.append(this.description);
sb.append(",parameters:");
sb.append(this.parameters);
sb.append(",content:");
sb.append(this.content);
sb.append(",status:");
sb.append(this.status);
sb.append(")");
return sb.toString();
}
}