/** * 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 Range implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("Range"); private static final TField MIN_FIELD_DESC = new TField("min", TType.I32, (short)1); private static final TField MAX_FIELD_DESC = new TField("max", TType.I32, (short)2); public final Integer min; public final Integer max; public static final int MIN = 1; public static final int MAX = 2; public Range( Integer min, Integer max) { this.min = min; this.max = max; } /** * Performs a deep copy on other. */ public Range(Range other) { if (other.isSetMin()) { this.min = TBaseHelper.deepCopy(other.min); } else { this.min = null; } if (other.isSetMax()) { this.max = TBaseHelper.deepCopy(other.max); } else { this.max = null; } } public Range deepCopy() { return new Range(this); } public Integer getMin() { return this.min; } // Returns true if field min is set (has been assigned a value) and false otherwise public boolean isSetMin() { return this.min != null; } public Integer getMax() { return this.max; } // Returns true if field max is set (has been assigned a value) and false otherwise public boolean isSetMax() { return this.max != null; } @Override public boolean equals(Object _that) { if (_that == null) return false; if (this == _that) return true; if (!(_that instanceof Range)) return false; Range that = (Range)_that; if (!TBaseHelper.equalsNobinary(this.isSetMin(), that.isSetMin(), this.min, that.min)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetMax(), that.isSetMax(), this.max, that.max)) { return false; } return true; } @Override public int hashCode() { return Arrays.deepHashCode(new Object[] {min, max}); } // 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 Range deserialize(TProtocol iprot) throws TException { Integer tmp_min = null; Integer tmp_max = null; TField __field; iprot.readStructBegin(); while (true) { __field = iprot.readFieldBegin(); if (__field.type == TType.STOP) { break; } switch (__field.id) { case MIN: if (__field.type == TType.I32) { tmp_min = iprot.readI32(); } else { TProtocolUtil.skip(iprot, __field.type); } break; case MAX: if (__field.type == TType.I32) { tmp_max = iprot.readI32(); } else { TProtocolUtil.skip(iprot, __field.type); } break; default: TProtocolUtil.skip(iprot, __field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); Range _that; _that = new Range( tmp_min ,tmp_max ); _that.validate(); return _that; } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.min != null) { oprot.writeFieldBegin(MIN_FIELD_DESC); oprot.writeI32(this.min); oprot.writeFieldEnd(); } if (this.max != null) { oprot.writeFieldBegin(MAX_FIELD_DESC); oprot.writeI32(this.max); 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 if (min == null) { throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'min' was not present! Struct: " + toString()); } if (max == null) { throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'max' was not present! Struct: " + toString()); } } }