BoundingBox.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.parquet.format;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
 * Bounding box for GEOMETRY or GEOGRAPHY type in the representation of min/max
 * value pair of coordinates from each axis.
 */
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class BoundingBox implements org.apache.thrift.TBase<BoundingBox, BoundingBox._Fields>, java.io.Serializable, Cloneable, Comparable<BoundingBox> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BoundingBox");

  private static final org.apache.thrift.protocol.TField XMIN_FIELD_DESC = new org.apache.thrift.protocol.TField("xmin", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
  private static final org.apache.thrift.protocol.TField XMAX_FIELD_DESC = new org.apache.thrift.protocol.TField("xmax", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
  private static final org.apache.thrift.protocol.TField YMIN_FIELD_DESC = new org.apache.thrift.protocol.TField("ymin", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
  private static final org.apache.thrift.protocol.TField YMAX_FIELD_DESC = new org.apache.thrift.protocol.TField("ymax", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
  private static final org.apache.thrift.protocol.TField ZMIN_FIELD_DESC = new org.apache.thrift.protocol.TField("zmin", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
  private static final org.apache.thrift.protocol.TField ZMAX_FIELD_DESC = new org.apache.thrift.protocol.TField("zmax", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
  private static final org.apache.thrift.protocol.TField MMIN_FIELD_DESC = new org.apache.thrift.protocol.TField("mmin", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
  private static final org.apache.thrift.protocol.TField MMAX_FIELD_DESC = new org.apache.thrift.protocol.TField("mmax", org.apache.thrift.protocol.TType.DOUBLE, (short)8);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new BoundingBoxStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new BoundingBoxTupleSchemeFactory();

  public double xmin; // required
  public double xmax; // required
  public double ymin; // required
  public double ymax; // required
  public double zmin; // optional
  public double zmax; // optional
  public double mmin; // optional
  public double mmax; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    XMIN((short)1, "xmin"),
    XMAX((short)2, "xmax"),
    YMIN((short)3, "ymin"),
    YMAX((short)4, "ymax"),
    ZMIN((short)5, "zmin"),
    ZMAX((short)6, "zmax"),
    MMIN((short)7, "mmin"),
    MMAX((short)8, "mmax");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // XMIN
          return XMIN;
        case 2: // XMAX
          return XMAX;
        case 3: // YMIN
          return YMIN;
        case 4: // YMAX
          return YMAX;
        case 5: // ZMIN
          return ZMIN;
        case 6: // ZMAX
          return ZMAX;
        case 7: // MMIN
          return MMIN;
        case 8: // MMAX
          return MMAX;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __XMIN_ISSET_ID = 0;
  private static final int __XMAX_ISSET_ID = 1;
  private static final int __YMIN_ISSET_ID = 2;
  private static final int __YMAX_ISSET_ID = 3;
  private static final int __ZMIN_ISSET_ID = 4;
  private static final int __ZMAX_ISSET_ID = 5;
  private static final int __MMIN_ISSET_ID = 6;
  private static final int __MMAX_ISSET_ID = 7;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ZMIN,_Fields.ZMAX,_Fields.MMIN,_Fields.MMAX};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.XMIN, new org.apache.thrift.meta_data.FieldMetaData("xmin", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.XMAX, new org.apache.thrift.meta_data.FieldMetaData("xmax", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.YMIN, new org.apache.thrift.meta_data.FieldMetaData("ymin", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.YMAX, new org.apache.thrift.meta_data.FieldMetaData("ymax", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.ZMIN, new org.apache.thrift.meta_data.FieldMetaData("zmin", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.ZMAX, new org.apache.thrift.meta_data.FieldMetaData("zmax", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MMIN, new org.apache.thrift.meta_data.FieldMetaData("mmin", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MMAX, new org.apache.thrift.meta_data.FieldMetaData("mmax", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BoundingBox.class, metaDataMap);
  }

  public BoundingBox() {
  }

  public BoundingBox(
    double xmin,
    double xmax,
    double ymin,
    double ymax)
  {
    this();
    this.xmin = xmin;
    setXminIsSet(true);
    this.xmax = xmax;
    setXmaxIsSet(true);
    this.ymin = ymin;
    setYminIsSet(true);
    this.ymax = ymax;
    setYmaxIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public BoundingBox(BoundingBox other) {
    __isset_bitfield = other.__isset_bitfield;
    this.xmin = other.xmin;
    this.xmax = other.xmax;
    this.ymin = other.ymin;
    this.ymax = other.ymax;
    this.zmin = other.zmin;
    this.zmax = other.zmax;
    this.mmin = other.mmin;
    this.mmax = other.mmax;
  }

  public BoundingBox deepCopy() {
    return new BoundingBox(this);
  }

  @Override
  public void clear() {
    setXminIsSet(false);
    this.xmin = 0.0;
    setXmaxIsSet(false);
    this.xmax = 0.0;
    setYminIsSet(false);
    this.ymin = 0.0;
    setYmaxIsSet(false);
    this.ymax = 0.0;
    setZminIsSet(false);
    this.zmin = 0.0;
    setZmaxIsSet(false);
    this.zmax = 0.0;
    setMminIsSet(false);
    this.mmin = 0.0;
    setMmaxIsSet(false);
    this.mmax = 0.0;
  }

  public double getXmin() {
    return this.xmin;
  }

  public BoundingBox setXmin(double xmin) {
    this.xmin = xmin;
    setXminIsSet(true);
    return this;
  }

  public void unsetXmin() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __XMIN_ISSET_ID);
  }

  /** Returns true if field xmin is set (has been assigned a value) and false otherwise */
  public boolean isSetXmin() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __XMIN_ISSET_ID);
  }

  public void setXminIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __XMIN_ISSET_ID, value);
  }

  public double getXmax() {
    return this.xmax;
  }

  public BoundingBox setXmax(double xmax) {
    this.xmax = xmax;
    setXmaxIsSet(true);
    return this;
  }

  public void unsetXmax() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __XMAX_ISSET_ID);
  }

  /** Returns true if field xmax is set (has been assigned a value) and false otherwise */
  public boolean isSetXmax() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __XMAX_ISSET_ID);
  }

  public void setXmaxIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __XMAX_ISSET_ID, value);
  }

  public double getYmin() {
    return this.ymin;
  }

  public BoundingBox setYmin(double ymin) {
    this.ymin = ymin;
    setYminIsSet(true);
    return this;
  }

  public void unsetYmin() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __YMIN_ISSET_ID);
  }

  /** Returns true if field ymin is set (has been assigned a value) and false otherwise */
  public boolean isSetYmin() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __YMIN_ISSET_ID);
  }

  public void setYminIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __YMIN_ISSET_ID, value);
  }

  public double getYmax() {
    return this.ymax;
  }

  public BoundingBox setYmax(double ymax) {
    this.ymax = ymax;
    setYmaxIsSet(true);
    return this;
  }

  public void unsetYmax() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __YMAX_ISSET_ID);
  }

  /** Returns true if field ymax is set (has been assigned a value) and false otherwise */
  public boolean isSetYmax() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __YMAX_ISSET_ID);
  }

  public void setYmaxIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __YMAX_ISSET_ID, value);
  }

  public double getZmin() {
    return this.zmin;
  }

  public BoundingBox setZmin(double zmin) {
    this.zmin = zmin;
    setZminIsSet(true);
    return this;
  }

  public void unsetZmin() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ZMIN_ISSET_ID);
  }

  /** Returns true if field zmin is set (has been assigned a value) and false otherwise */
  public boolean isSetZmin() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ZMIN_ISSET_ID);
  }

  public void setZminIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ZMIN_ISSET_ID, value);
  }

  public double getZmax() {
    return this.zmax;
  }

  public BoundingBox setZmax(double zmax) {
    this.zmax = zmax;
    setZmaxIsSet(true);
    return this;
  }

  public void unsetZmax() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ZMAX_ISSET_ID);
  }

  /** Returns true if field zmax is set (has been assigned a value) and false otherwise */
  public boolean isSetZmax() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ZMAX_ISSET_ID);
  }

  public void setZmaxIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ZMAX_ISSET_ID, value);
  }

  public double getMmin() {
    return this.mmin;
  }

  public BoundingBox setMmin(double mmin) {
    this.mmin = mmin;
    setMminIsSet(true);
    return this;
  }

  public void unsetMmin() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MMIN_ISSET_ID);
  }

  /** Returns true if field mmin is set (has been assigned a value) and false otherwise */
  public boolean isSetMmin() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MMIN_ISSET_ID);
  }

  public void setMminIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MMIN_ISSET_ID, value);
  }

  public double getMmax() {
    return this.mmax;
  }

  public BoundingBox setMmax(double mmax) {
    this.mmax = mmax;
    setMmaxIsSet(true);
    return this;
  }

  public void unsetMmax() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MMAX_ISSET_ID);
  }

  /** Returns true if field mmax is set (has been assigned a value) and false otherwise */
  public boolean isSetMmax() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MMAX_ISSET_ID);
  }

  public void setMmaxIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MMAX_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case XMIN:
      if (value == null) {
        unsetXmin();
      } else {
        setXmin((java.lang.Double)value);
      }
      break;

    case XMAX:
      if (value == null) {
        unsetXmax();
      } else {
        setXmax((java.lang.Double)value);
      }
      break;

    case YMIN:
      if (value == null) {
        unsetYmin();
      } else {
        setYmin((java.lang.Double)value);
      }
      break;

    case YMAX:
      if (value == null) {
        unsetYmax();
      } else {
        setYmax((java.lang.Double)value);
      }
      break;

    case ZMIN:
      if (value == null) {
        unsetZmin();
      } else {
        setZmin((java.lang.Double)value);
      }
      break;

    case ZMAX:
      if (value == null) {
        unsetZmax();
      } else {
        setZmax((java.lang.Double)value);
      }
      break;

    case MMIN:
      if (value == null) {
        unsetMmin();
      } else {
        setMmin((java.lang.Double)value);
      }
      break;

    case MMAX:
      if (value == null) {
        unsetMmax();
      } else {
        setMmax((java.lang.Double)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case XMIN:
      return getXmin();

    case XMAX:
      return getXmax();

    case YMIN:
      return getYmin();

    case YMAX:
      return getYmax();

    case ZMIN:
      return getZmin();

    case ZMAX:
      return getZmax();

    case MMIN:
      return getMmin();

    case MMAX:
      return getMmax();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case XMIN:
      return isSetXmin();
    case XMAX:
      return isSetXmax();
    case YMIN:
      return isSetYmin();
    case YMAX:
      return isSetYmax();
    case ZMIN:
      return isSetZmin();
    case ZMAX:
      return isSetZmax();
    case MMIN:
      return isSetMmin();
    case MMAX:
      return isSetMmax();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof BoundingBox)
      return this.equals((BoundingBox)that);
    return false;
  }

  public boolean equals(BoundingBox that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_xmin = true;
    boolean that_present_xmin = true;
    if (this_present_xmin || that_present_xmin) {
      if (!(this_present_xmin && that_present_xmin))
        return false;
      if (this.xmin != that.xmin)
        return false;
    }

    boolean this_present_xmax = true;
    boolean that_present_xmax = true;
    if (this_present_xmax || that_present_xmax) {
      if (!(this_present_xmax && that_present_xmax))
        return false;
      if (this.xmax != that.xmax)
        return false;
    }

    boolean this_present_ymin = true;
    boolean that_present_ymin = true;
    if (this_present_ymin || that_present_ymin) {
      if (!(this_present_ymin && that_present_ymin))
        return false;
      if (this.ymin != that.ymin)
        return false;
    }

    boolean this_present_ymax = true;
    boolean that_present_ymax = true;
    if (this_present_ymax || that_present_ymax) {
      if (!(this_present_ymax && that_present_ymax))
        return false;
      if (this.ymax != that.ymax)
        return false;
    }

    boolean this_present_zmin = true && this.isSetZmin();
    boolean that_present_zmin = true && that.isSetZmin();
    if (this_present_zmin || that_present_zmin) {
      if (!(this_present_zmin && that_present_zmin))
        return false;
      if (this.zmin != that.zmin)
        return false;
    }

    boolean this_present_zmax = true && this.isSetZmax();
    boolean that_present_zmax = true && that.isSetZmax();
    if (this_present_zmax || that_present_zmax) {
      if (!(this_present_zmax && that_present_zmax))
        return false;
      if (this.zmax != that.zmax)
        return false;
    }

    boolean this_present_mmin = true && this.isSetMmin();
    boolean that_present_mmin = true && that.isSetMmin();
    if (this_present_mmin || that_present_mmin) {
      if (!(this_present_mmin && that_present_mmin))
        return false;
      if (this.mmin != that.mmin)
        return false;
    }

    boolean this_present_mmax = true && this.isSetMmax();
    boolean that_present_mmax = true && that.isSetMmax();
    if (this_present_mmax || that_present_mmax) {
      if (!(this_present_mmax && that_present_mmax))
        return false;
      if (this.mmax != that.mmax)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(xmin);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(xmax);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(ymin);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(ymax);

    hashCode = hashCode * 8191 + ((isSetZmin()) ? 131071 : 524287);
    if (isSetZmin())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(zmin);

    hashCode = hashCode * 8191 + ((isSetZmax()) ? 131071 : 524287);
    if (isSetZmax())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(zmax);

    hashCode = hashCode * 8191 + ((isSetMmin()) ? 131071 : 524287);
    if (isSetMmin())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(mmin);

    hashCode = hashCode * 8191 + ((isSetMmax()) ? 131071 : 524287);
    if (isSetMmax())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(mmax);

    return hashCode;
  }

  @Override
  public int compareTo(BoundingBox other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetXmin(), other.isSetXmin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetXmin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xmin, other.xmin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetXmax(), other.isSetXmax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetXmax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xmax, other.xmax);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetYmin(), other.isSetYmin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetYmin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ymin, other.ymin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetYmax(), other.isSetYmax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetYmax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ymax, other.ymax);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetZmin(), other.isSetZmin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetZmin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.zmin, other.zmin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetZmax(), other.isSetZmax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetZmax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.zmax, other.zmax);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMmin(), other.isSetMmin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMmin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mmin, other.mmin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMmax(), other.isSetMmax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMmax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mmax, other.mmax);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("BoundingBox(");
    boolean first = true;

    sb.append("xmin:");
    sb.append(this.xmin);
    first = false;
    if (!first) sb.append(", ");
    sb.append("xmax:");
    sb.append(this.xmax);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ymin:");
    sb.append(this.ymin);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ymax:");
    sb.append(this.ymax);
    first = false;
    if (isSetZmin()) {
      if (!first) sb.append(", ");
      sb.append("zmin:");
      sb.append(this.zmin);
      first = false;
    }
    if (isSetZmax()) {
      if (!first) sb.append(", ");
      sb.append("zmax:");
      sb.append(this.zmax);
      first = false;
    }
    if (isSetMmin()) {
      if (!first) sb.append(", ");
      sb.append("mmin:");
      sb.append(this.mmin);
      first = false;
    }
    if (isSetMmax()) {
      if (!first) sb.append(", ");
      sb.append("mmax:");
      sb.append(this.mmax);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'xmin' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'xmax' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'ymin' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'ymax' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class BoundingBoxStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public BoundingBoxStandardScheme getScheme() {
      return new BoundingBoxStandardScheme();
    }
  }

  private static class BoundingBoxStandardScheme extends org.apache.thrift.scheme.StandardScheme<BoundingBox> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, BoundingBox struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // XMIN
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.xmin = iprot.readDouble();
              struct.setXminIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // XMAX
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.xmax = iprot.readDouble();
              struct.setXmaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // YMIN
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.ymin = iprot.readDouble();
              struct.setYminIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // YMAX
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.ymax = iprot.readDouble();
              struct.setYmaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // ZMIN
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.zmin = iprot.readDouble();
              struct.setZminIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ZMAX
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.zmax = iprot.readDouble();
              struct.setZmaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // MMIN
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.mmin = iprot.readDouble();
              struct.setMminIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // MMAX
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.mmax = iprot.readDouble();
              struct.setMmaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetXmin()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'xmin' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetXmax()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'xmax' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetYmin()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'ymin' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetYmax()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'ymax' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, BoundingBox struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(XMIN_FIELD_DESC);
      oprot.writeDouble(struct.xmin);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(XMAX_FIELD_DESC);
      oprot.writeDouble(struct.xmax);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(YMIN_FIELD_DESC);
      oprot.writeDouble(struct.ymin);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(YMAX_FIELD_DESC);
      oprot.writeDouble(struct.ymax);
      oprot.writeFieldEnd();
      if (struct.isSetZmin()) {
        oprot.writeFieldBegin(ZMIN_FIELD_DESC);
        oprot.writeDouble(struct.zmin);
        oprot.writeFieldEnd();
      }
      if (struct.isSetZmax()) {
        oprot.writeFieldBegin(ZMAX_FIELD_DESC);
        oprot.writeDouble(struct.zmax);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMmin()) {
        oprot.writeFieldBegin(MMIN_FIELD_DESC);
        oprot.writeDouble(struct.mmin);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMmax()) {
        oprot.writeFieldBegin(MMAX_FIELD_DESC);
        oprot.writeDouble(struct.mmax);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class BoundingBoxTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public BoundingBoxTupleScheme getScheme() {
      return new BoundingBoxTupleScheme();
    }
  }

  private static class BoundingBoxTupleScheme extends org.apache.thrift.scheme.TupleScheme<BoundingBox> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, BoundingBox struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeDouble(struct.xmin);
      oprot.writeDouble(struct.xmax);
      oprot.writeDouble(struct.ymin);
      oprot.writeDouble(struct.ymax);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetZmin()) {
        optionals.set(0);
      }
      if (struct.isSetZmax()) {
        optionals.set(1);
      }
      if (struct.isSetMmin()) {
        optionals.set(2);
      }
      if (struct.isSetMmax()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetZmin()) {
        oprot.writeDouble(struct.zmin);
      }
      if (struct.isSetZmax()) {
        oprot.writeDouble(struct.zmax);
      }
      if (struct.isSetMmin()) {
        oprot.writeDouble(struct.mmin);
      }
      if (struct.isSetMmax()) {
        oprot.writeDouble(struct.mmax);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, BoundingBox struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.xmin = iprot.readDouble();
      struct.setXminIsSet(true);
      struct.xmax = iprot.readDouble();
      struct.setXmaxIsSet(true);
      struct.ymin = iprot.readDouble();
      struct.setYminIsSet(true);
      struct.ymax = iprot.readDouble();
      struct.setYmaxIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.zmin = iprot.readDouble();
        struct.setZminIsSet(true);
      }
      if (incoming.get(1)) {
        struct.zmax = iprot.readDouble();
        struct.setZmaxIsSet(true);
      }
      if (incoming.get(2)) {
        struct.mmin = iprot.readDouble();
        struct.setMminIsSet(true);
      }
      if (incoming.get(3)) {
        struct.mmax = iprot.readDouble();
        struct.setMmaxIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}