コード例 #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, Location struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.city != null) {
        if (struct.is_set_city()) {
          oprot.writeFieldBegin(CITY_FIELD_DESC);
          oprot.writeString(struct.city);
          oprot.writeFieldEnd();
        }
      }
      if (struct.state != null) {
        if (struct.is_set_state()) {
          oprot.writeFieldBegin(STATE_FIELD_DESC);
          oprot.writeString(struct.state);
          oprot.writeFieldEnd();
        }
      }
      if (struct.country != null) {
        if (struct.is_set_country()) {
          oprot.writeFieldBegin(COUNTRY_FIELD_DESC);
          oprot.writeString(struct.country);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #2
0
  public boolean equals(Location that) {
    if (that == null) return false;

    boolean this_present_city = true && this.is_set_city();
    boolean that_present_city = true && that.is_set_city();
    if (this_present_city || that_present_city) {
      if (!(this_present_city && that_present_city)) return false;
      if (!this.city.equals(that.city)) return false;
    }

    boolean this_present_state = true && this.is_set_state();
    boolean that_present_state = true && that.is_set_state();
    if (this_present_state || that_present_state) {
      if (!(this_present_state && that_present_state)) return false;
      if (!this.state.equals(that.state)) return false;
    }

    boolean this_present_country = true && this.is_set_country();
    boolean that_present_country = true && that.is_set_country();
    if (this_present_country || that_present_country) {
      if (!(this_present_country && that_present_country)) return false;
      if (!this.country.equals(that.country)) return false;
    }

    return true;
  }
コード例 #3
0
 /** Performs a deep copy on <i>other</i>. */
 public Location(Location other) {
   if (other.is_set_city()) {
     this.city = other.city;
   }
   if (other.is_set_state()) {
     this.state = other.state;
   }
   if (other.is_set_country()) {
     this.country = other.country;
   }
 }
コード例 #4
0
 public void write(org.apache.thrift.protocol.TProtocol prot, Location struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.is_set_city()) {
     optionals.set(0);
   }
   if (struct.is_set_state()) {
     optionals.set(1);
   }
   if (struct.is_set_country()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.is_set_city()) {
     oprot.writeString(struct.city);
   }
   if (struct.is_set_state()) {
     oprot.writeString(struct.state);
   }
   if (struct.is_set_country()) {
     oprot.writeString(struct.country);
   }
 }
コード例 #5
0
  public int compareTo(Location other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(is_set_city()).compareTo(other.is_set_city());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_city()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.city, other.city);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_state()).compareTo(other.is_set_state());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_state()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_country()).compareTo(other.is_set_country());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_country()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.country, other.country);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }