/** * 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.*; /** * A patch for an 64-bit floating point value. */ @SuppressWarnings({ "unused", "serial" }) public class DoublePatch implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("DoublePatch"); private static final TField ASSIGN_FIELD_DESC = new TField("assign", TType.DOUBLE, (short)1); private static final TField CLEAR_FIELD_DESC = new TField("clear", TType.BOOL, (short)2); private static final TField ADD_FIELD_DESC = new TField("add", TType.DOUBLE, (short)8); /** * Assigns to a (set) value. * * If set, all other patch operations are ignored. * * Note: Only modifies set field values. */ public final Double assign; /** * Clear any set value. */ public final Boolean clear; /** * Add to a given value. */ public final Double add; public static final int ASSIGN = 1; public static final int CLEAR = 2; public static final int ADD = 8; public DoublePatch( Double assign, Boolean clear, Double add) { this.assign = assign; this.clear = clear; this.add = add; } /** * Performs a deep copy on other. */ public DoublePatch(DoublePatch other) { if (other.isSetAssign()) { this.assign = TBaseHelper.deepCopy(other.assign); } else { this.assign = null; } if (other.isSetClear()) { this.clear = TBaseHelper.deepCopy(other.clear); } else { this.clear = null; } if (other.isSetAdd()) { this.add = TBaseHelper.deepCopy(other.add); } else { this.add = null; } } public DoublePatch deepCopy() { return new DoublePatch(this); } /** * Assigns to a (set) value. * * If set, all other patch operations are ignored. * * Note: Only modifies set field values. */ public Double getAssign() { return this.assign; } // Returns true if field assign is set (has been assigned a value) and false otherwise public boolean isSetAssign() { return this.assign != null; } /** * Clear any set value. */ public Boolean isClear() { return this.clear; } // Returns true if field clear is set (has been assigned a value) and false otherwise public boolean isSetClear() { return this.clear != null; } /** * Add to a given value. */ public Double getAdd() { return this.add; } // Returns true if field add is set (has been assigned a value) and false otherwise public boolean isSetAdd() { return this.add != null; } @Override public boolean equals(Object _that) { if (_that == null) return false; if (this == _that) return true; if (!(_that instanceof DoublePatch)) return false; DoublePatch that = (DoublePatch)_that; if (!TBaseHelper.equalsNobinary(this.isSetAssign(), that.isSetAssign(), this.assign, that.assign)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetClear(), that.isSetClear(), this.clear, that.clear)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetAdd(), that.isSetAdd(), this.add, that.add)) { return false; } return true; } @Override public int hashCode() { return Arrays.deepHashCode(new Object[] {assign, clear, add}); } // This is required to satisfy the TBase interface, but can't be implemented on immutable struture. public void read(TProtocol iprot) throws TException { throw new TException("unimplemented in android immutable structure"); } public static DoublePatch deserialize(TProtocol iprot) throws TException { Double tmp_assign = null; Boolean tmp_clear = null; Double tmp_add = null; TField __field; iprot.readStructBegin(); while (true) { __field = iprot.readFieldBegin(); if (__field.type == TType.STOP) { break; } switch (__field.id) { case ASSIGN: if (__field.type == TType.DOUBLE) { tmp_assign = iprot.readDouble(); } else { TProtocolUtil.skip(iprot, __field.type); } break; case CLEAR: if (__field.type == TType.BOOL) { tmp_clear = iprot.readBool(); } else { TProtocolUtil.skip(iprot, __field.type); } break; case ADD: if (__field.type == TType.DOUBLE) { tmp_add = iprot.readDouble(); } else { TProtocolUtil.skip(iprot, __field.type); } break; default: TProtocolUtil.skip(iprot, __field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); DoublePatch _that; _that = new DoublePatch( tmp_assign ,tmp_clear ,tmp_add ); _that.validate(); return _that; } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.assign != null) { if (isSetAssign()) { oprot.writeFieldBegin(ASSIGN_FIELD_DESC); oprot.writeDouble(this.assign); oprot.writeFieldEnd(); } } if (this.clear != null) { oprot.writeFieldBegin(CLEAR_FIELD_DESC); oprot.writeBool(this.clear); oprot.writeFieldEnd(); } if (this.add != null) { oprot.writeFieldBegin(ADD_FIELD_DESC); oprot.writeDouble(this.add); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { return toString(1, true); } @Override public String toString(int indent, boolean prettyPrint) { return TBaseHelper.toStringHelper(this, indent, prettyPrint); } public void validate() throws TException { // check for required fields } }