/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package org.thrudb.thrudex; 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 java.util.Collections; import org.apache.thrift.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.protocol.*; public class ThrudexException extends Exception implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("ThrudexException"); private static final TField WHAT_FIELD_DESC = new TField("what", TType.STRING, (short)1); public String what; public static final int WHAT = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{ put(WHAT, new FieldMetaData("what", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { FieldMetaData.addStructMetaDataMap(ThrudexException.class, metaDataMap); } public ThrudexException() { } public ThrudexException( String what) { this(); this.what = what; } /** * Performs a deep copy on <i>other</i>. */ public ThrudexException(ThrudexException other) { if (other.isSetWhat()) { this.what = other.what; } } @Override public ThrudexException clone() { return new ThrudexException(this); } public String getWhat() { return this.what; } public void setWhat(String what) { this.what = what; } public void unsetWhat() { this.what = null; } // Returns true if field what is set (has been asigned a value) and false otherwise public boolean isSetWhat() { return this.what != null; } public void setWhatIsSet(boolean value) { if (!value) { this.what = null; } } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case WHAT: if (value == null) { unsetWhat(); } else { setWhat((String)value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case WHAT: return getWhat(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case WHAT: return isSetWhat(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ThrudexException) return this.equals((ThrudexException)that); return false; } public boolean equals(ThrudexException that) { if (that == null) return false; boolean this_present_what = true && this.isSetWhat(); boolean that_present_what = true && that.isSetWhat(); if (this_present_what || that_present_what) { if (!(this_present_what && that_present_what)) return false; if (!this.what.equals(that.what)) return false; } return true; } @Override 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 WHAT: if (field.type == TType.STRING) { this.what = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.what != null) { oprot.writeFieldBegin(WHAT_FIELD_DESC); oprot.writeString(this.what); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("ThrudexException("); boolean first = true; sb.append("what:"); if (this.what == null) { sb.append("null"); } else { sb.append(this.what); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields // check that fields of type enum have valid values } }