예제 #1
0
  public int compareTo(DomainVersionMetadata other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    DomainVersionMetadata typedOther = (DomainVersionMetadata) other;

    lastComparison = Boolean.valueOf(is_set_properties()).compareTo(typedOther.is_set_properties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_properties()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.properties, typedOther.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_partitions()).compareTo(typedOther.is_set_partitions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_partitions()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.partitions, typedOther.partitions);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_defunct()).compareTo(typedOther.is_set_defunct());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_defunct()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defunct, typedOther.defunct);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_closed_at()).compareTo(typedOther.is_set_closed_at());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_closed_at()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.closed_at, typedOther.closed_at);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, DomainVersionMetadata 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: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.properties = iprot.readBinary();
              struct.set_properties_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PARTITIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.partitions = new HashMap<Integer, PartitionMetadata>(2 * _map8.size);
                for (int _i9 = 0; _i9 < _map8.size; ++_i9) {
                  int _key10; // required
                  PartitionMetadata _val11; // optional
                  _key10 = iprot.readI32();
                  _val11 = new PartitionMetadata();
                  _val11.read(iprot);
                  struct.partitions.put(_key10, _val11);
                }
                iprot.readMapEnd();
              }
              struct.set_partitions_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DEFUNCT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.defunct = iprot.readBool();
              struct.set_defunct_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CLOSED_AT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.closed_at = iprot.readI64();
              struct.set_closed_at_isSet(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.is_set_defunct()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'defunct' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.is_set_closed_at()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'closed_at' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }