예제 #1
0
  public boolean equals(DomainVersionMetadata that) {
    if (that == null) return false;

    boolean this_present_properties = true && this.is_set_properties();
    boolean that_present_properties = true && that.is_set_properties();
    if (this_present_properties || that_present_properties) {
      if (!(this_present_properties && that_present_properties)) return false;
      if (!this.properties.equals(that.properties)) return false;
    }

    boolean this_present_partitions = true && this.is_set_partitions();
    boolean that_present_partitions = true && that.is_set_partitions();
    if (this_present_partitions || that_present_partitions) {
      if (!(this_present_partitions && that_present_partitions)) return false;
      if (!this.partitions.equals(that.partitions)) return false;
    }

    boolean this_present_defunct = true;
    boolean that_present_defunct = true;
    if (this_present_defunct || that_present_defunct) {
      if (!(this_present_defunct && that_present_defunct)) return false;
      if (this.defunct != that.defunct) return false;
    }

    boolean this_present_closed_at = true;
    boolean that_present_closed_at = true;
    if (this_present_closed_at || that_present_closed_at) {
      if (!(this_present_closed_at && that_present_closed_at)) return false;
      if (this.closed_at != that.closed_at) return false;
    }

    return true;
  }
예제 #2
0
  /** Performs a deep copy on <i>other</i>. */
  public DomainVersionMetadata(DomainVersionMetadata other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.is_set_properties()) {
      this.properties = org.apache.thrift.TBaseHelper.copyBinary(other.properties);
      ;
    }
    if (other.is_set_partitions()) {
      Map<Integer, PartitionMetadata> __this__partitions =
          new HashMap<Integer, PartitionMetadata>();
      for (Map.Entry<Integer, PartitionMetadata> other_element : other.partitions.entrySet()) {

        Integer other_element_key = other_element.getKey();
        PartitionMetadata other_element_value = other_element.getValue();

        Integer __this__partitions_copy_key = other_element_key;

        PartitionMetadata __this__partitions_copy_value =
            new PartitionMetadata(other_element_value);

        __this__partitions.put(__this__partitions_copy_key, __this__partitions_copy_value);
      }
      this.partitions = __this__partitions;
    }
    this.defunct = other.defunct;
    this.closed_at = other.closed_at;
  }
예제 #3
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, DomainVersionMetadata struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   {
     org.apache.thrift.protocol.TMap _map14 =
         new org.apache.thrift.protocol.TMap(
             org.apache.thrift.protocol.TType.I32,
             org.apache.thrift.protocol.TType.STRUCT,
             iprot.readI32());
     struct.partitions = new HashMap<Integer, PartitionMetadata>(2 * _map14.size);
     for (int _i15 = 0; _i15 < _map14.size; ++_i15) {
       int _key16; // required
       PartitionMetadata _val17; // optional
       _key16 = iprot.readI32();
       _val17 = new PartitionMetadata();
       _val17.read(iprot);
       struct.partitions.put(_key16, _val17);
     }
   }
   struct.set_partitions_isSet(true);
   struct.defunct = iprot.readBool();
   struct.set_defunct_isSet(true);
   struct.closed_at = iprot.readI64();
   struct.set_closed_at_isSet(true);
   BitSet incoming = iprot.readBitSet(1);
   if (incoming.get(0)) {
     struct.properties = iprot.readBinary();
     struct.set_properties_isSet(true);
   }
 }
예제 #4
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, DomainVersionMetadata struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.properties != null) {
        oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
        oprot.writeBinary(struct.properties);
        oprot.writeFieldEnd();
      }
      if (struct.partitions != null) {
        oprot.writeFieldBegin(PARTITIONS_FIELD_DESC);
        {
          oprot.writeMapBegin(
              new org.apache.thrift.protocol.TMap(
                  org.apache.thrift.protocol.TType.I32,
                  org.apache.thrift.protocol.TType.STRUCT,
                  struct.partitions.size()));
          for (Map.Entry<Integer, PartitionMetadata> _iter12 : struct.partitions.entrySet()) {
            oprot.writeI32(_iter12.getKey());
            _iter12.getValue().write(oprot);
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(DEFUNCT_FIELD_DESC);
      oprot.writeBool(struct.defunct);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CLOSED_AT_FIELD_DESC);
      oprot.writeI64(struct.closed_at);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
예제 #5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, DomainVersionMetadata struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   {
     oprot.writeI32(struct.partitions.size());
     for (Map.Entry<Integer, PartitionMetadata> _iter13 : struct.partitions.entrySet()) {
       oprot.writeI32(_iter13.getKey());
       _iter13.getValue().write(oprot);
     }
   }
   oprot.writeBool(struct.defunct);
   oprot.writeI64(struct.closed_at);
   BitSet optionals = new BitSet();
   if (struct.is_set_properties()) {
     optionals.set(0);
   }
   oprot.writeBitSet(optionals, 1);
   if (struct.is_set_properties()) {
     oprot.writeBinary(struct.properties);
   }
 }
예제 #6
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;
  }
예제 #7
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();
    }