/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ 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 java.util.BitSet; import java.util.Arrays; import com.facebook.thrift.*; import com.facebook.thrift.annotations.*; import com.facebook.thrift.async.*; import com.facebook.thrift.meta_data.*; import com.facebook.thrift.server.*; import com.facebook.thrift.transport.*; import com.facebook.thrift.protocol.*; @SuppressWarnings({ "unused", "serial" }) public class Fiery extends Exception implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("Fiery"); private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1); public String message; public static final int MESSAGE = 1; // isset id assignments public static final Map metaDataMap; static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(MESSAGE, new FieldMetaData("message", TFieldRequirementType.REQUIRED, new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { FieldMetaData.addStructMetaDataMap(Fiery.class, metaDataMap); } public Fiery() { } public Fiery( String message) { this(); this.message = message; } public static class Builder { private String message; public Builder() { } public Builder setMessage(final String message) { this.message = message; return this; } public Fiery build() { Fiery result = new Fiery(); result.setMessage(this.message); return result; } } public static Builder builder() { return new Builder(); } /** * Performs a deep copy on other. */ public Fiery(Fiery other) { if (other.isSetMessage()) { this.message = TBaseHelper.deepCopy(other.message); } } public Fiery deepCopy() { return new Fiery(this); } public String getMessage() { return this.message; } public Fiery setMessage(String message) { this.message = message; return this; } public void unsetMessage() { this.message = null; } // Returns true if field message is set (has been assigned a value) and false otherwise public boolean isSetMessage() { return this.message != null; } public void setMessageIsSet(boolean __value) { if (!__value) { this.message = null; } } public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case MESSAGE: if (__value == null) { unsetMessage(); } else { setMessage((String)__value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case MESSAGE: return getMessage(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object _that) { if (_that == null) return false; if (this == _that) return true; if (!(_that instanceof Fiery)) return false; Fiery that = (Fiery)_that; if (!TBaseHelper.equalsNobinary(this.isSetMessage(), that.isSetMessage(), this.message, that.message)) { return false; } return true; } @Override public int hashCode() { return Arrays.deepHashCode(new Object[] {message}); } public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); while (true) { __field = iprot.readFieldBegin(); if (__field.type == TType.STOP) { break; } switch (__field.id) { case MESSAGE: if (__field.type == TType.STRING) { this.message = 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.message != null) { oprot.writeFieldBegin(MESSAGE_FIELD_DESC); oprot.writeString(this.message); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { return toString(1, true); } @Override public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; StringBuilder sb = new StringBuilder("Fiery"); sb.append(space); sb.append("("); sb.append(newLine); boolean first = true; sb.append(indentStr); sb.append("message"); sb.append(space); sb.append(":").append(space); if (this.getMessage() == null) { sb.append("null"); } else { sb.append(TBaseHelper.toString(this.getMessage(), indent + 1, prettyPrint)); } first = false; sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields if (message == null) { throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'message' was not present! Struct: " + toString()); } } }