/** Performs a deep copy on <i>other</i>. */
 public StorageResourceDescription(StorageResourceDescription other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetStorageResourceId()) {
     this.storageResourceId = other.storageResourceId;
   }
   if (other.isSetHostName()) {
     this.hostName = other.hostName;
   }
   if (other.isSetStorageResourceDescription()) {
     this.storageResourceDescription = other.storageResourceDescription;
   }
   this.enabled = other.enabled;
   if (other.isSetDataMovementInterfaces()) {
     List<org.apache.airavata.model.data.movement.DataMovementInterface>
         __this__dataMovementInterfaces =
             new ArrayList<org.apache.airavata.model.data.movement.DataMovementInterface>(
                 other.dataMovementInterfaces.size());
     for (org.apache.airavata.model.data.movement.DataMovementInterface other_element :
         other.dataMovementInterfaces) {
       __this__dataMovementInterfaces.add(
           new org.apache.airavata.model.data.movement.DataMovementInterface(other_element));
     }
     this.dataMovementInterfaces = __this__dataMovementInterfaces;
   }
 }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, StorageResourceDescription struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.storageResourceId = iprot.readString();
   struct.setStorageResourceIdIsSet(true);
   struct.hostName = iprot.readString();
   struct.setHostNameIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.storageResourceDescription = iprot.readString();
     struct.setStorageResourceDescriptionIsSet(true);
   }
   if (incoming.get(1)) {
     struct.enabled = iprot.readBool();
     struct.setEnabledIsSet(true);
   }
   if (incoming.get(2)) {
     {
       org.apache.thrift.protocol.TList _list5 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.dataMovementInterfaces =
           new ArrayList<org.apache.airavata.model.data.movement.DataMovementInterface>(
               _list5.size);
       org.apache.airavata.model.data.movement.DataMovementInterface _elem6;
       for (int _i7 = 0; _i7 < _list5.size; ++_i7) {
         _elem6 = new org.apache.airavata.model.data.movement.DataMovementInterface();
         _elem6.read(iprot);
         struct.dataMovementInterfaces.add(_elem6);
       }
     }
     struct.setDataMovementInterfacesIsSet(true);
   }
 }
    public void write(org.apache.thrift.protocol.TProtocol oprot, StorageResourceDescription struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.storageResourceId != null) {
        oprot.writeFieldBegin(STORAGE_RESOURCE_ID_FIELD_DESC);
        oprot.writeString(struct.storageResourceId);
        oprot.writeFieldEnd();
      }
      if (struct.hostName != null) {
        oprot.writeFieldBegin(HOST_NAME_FIELD_DESC);
        oprot.writeString(struct.hostName);
        oprot.writeFieldEnd();
      }
      if (struct.storageResourceDescription != null) {
        if (struct.isSetStorageResourceDescription()) {
          oprot.writeFieldBegin(STORAGE_RESOURCE_DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.storageResourceDescription);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetEnabled()) {
        oprot.writeFieldBegin(ENABLED_FIELD_DESC);
        oprot.writeBool(struct.enabled);
        oprot.writeFieldEnd();
      }
      if (struct.dataMovementInterfaces != null) {
        if (struct.isSetDataMovementInterfaces()) {
          oprot.writeFieldBegin(DATA_MOVEMENT_INTERFACES_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRUCT, struct.dataMovementInterfaces.size()));
            for (org.apache.airavata.model.data.movement.DataMovementInterface _iter3 :
                struct.dataMovementInterfaces) {
              _iter3.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  public boolean equals(StorageResourceDescription that) {
    if (that == null) return false;

    boolean this_present_storageResourceId = true && this.isSetStorageResourceId();
    boolean that_present_storageResourceId = true && that.isSetStorageResourceId();
    if (this_present_storageResourceId || that_present_storageResourceId) {
      if (!(this_present_storageResourceId && that_present_storageResourceId)) return false;
      if (!this.storageResourceId.equals(that.storageResourceId)) return false;
    }

    boolean this_present_hostName = true && this.isSetHostName();
    boolean that_present_hostName = true && that.isSetHostName();
    if (this_present_hostName || that_present_hostName) {
      if (!(this_present_hostName && that_present_hostName)) return false;
      if (!this.hostName.equals(that.hostName)) return false;
    }

    boolean this_present_storageResourceDescription =
        true && this.isSetStorageResourceDescription();
    boolean that_present_storageResourceDescription =
        true && that.isSetStorageResourceDescription();
    if (this_present_storageResourceDescription || that_present_storageResourceDescription) {
      if (!(this_present_storageResourceDescription && that_present_storageResourceDescription))
        return false;
      if (!this.storageResourceDescription.equals(that.storageResourceDescription)) return false;
    }

    boolean this_present_enabled = true && this.isSetEnabled();
    boolean that_present_enabled = true && that.isSetEnabled();
    if (this_present_enabled || that_present_enabled) {
      if (!(this_present_enabled && that_present_enabled)) return false;
      if (this.enabled != that.enabled) return false;
    }

    boolean this_present_dataMovementInterfaces = true && this.isSetDataMovementInterfaces();
    boolean that_present_dataMovementInterfaces = true && that.isSetDataMovementInterfaces();
    if (this_present_dataMovementInterfaces || that_present_dataMovementInterfaces) {
      if (!(this_present_dataMovementInterfaces && that_present_dataMovementInterfaces))
        return false;
      if (!this.dataMovementInterfaces.equals(that.dataMovementInterfaces)) return false;
    }

    return true;
  }
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, StorageResourceDescription struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeString(struct.storageResourceId);
   oprot.writeString(struct.hostName);
   BitSet optionals = new BitSet();
   if (struct.isSetStorageResourceDescription()) {
     optionals.set(0);
   }
   if (struct.isSetEnabled()) {
     optionals.set(1);
   }
   if (struct.isSetDataMovementInterfaces()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetStorageResourceDescription()) {
     oprot.writeString(struct.storageResourceDescription);
   }
   if (struct.isSetEnabled()) {
     oprot.writeBool(struct.enabled);
   }
   if (struct.isSetDataMovementInterfaces()) {
     {
       oprot.writeI32(struct.dataMovementInterfaces.size());
       for (org.apache.airavata.model.data.movement.DataMovementInterface _iter4 :
           struct.dataMovementInterfaces) {
         _iter4.write(oprot);
       }
     }
   }
 }
 public void read(org.apache.thrift.protocol.TProtocol iprot, StorageResourceDescription 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: // STORAGE_RESOURCE_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.storageResourceId = iprot.readString();
           struct.setStorageResourceIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // HOST_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.hostName = iprot.readString();
           struct.setHostNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // STORAGE_RESOURCE_DESCRIPTION
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.storageResourceDescription = iprot.readString();
           struct.setStorageResourceDescriptionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // ENABLED
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.enabled = iprot.readBool();
           struct.setEnabledIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // DATA_MOVEMENT_INTERFACES
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
             struct.dataMovementInterfaces =
                 new ArrayList<org.apache.airavata.model.data.movement.DataMovementInterface>(
                     _list0.size);
             org.apache.airavata.model.data.movement.DataMovementInterface _elem1;
             for (int _i2 = 0; _i2 < _list0.size; ++_i2) {
               _elem1 = new org.apache.airavata.model.data.movement.DataMovementInterface();
               _elem1.read(iprot);
               struct.dataMovementInterfaces.add(_elem1);
             }
             iprot.readListEnd();
           }
           struct.setDataMovementInterfacesIsSet(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();
   struct.validate();
 }
  @Override
  public int compareTo(StorageResourceDescription other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison =
        Boolean.valueOf(isSetStorageResourceId()).compareTo(other.isSetStorageResourceId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageResourceId()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.storageResourceId, other.storageResourceId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHostName()).compareTo(other.isSetHostName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHostName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostName, other.hostName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetStorageResourceDescription())
            .compareTo(other.isSetStorageResourceDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageResourceDescription()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.storageResourceDescription, other.storageResourceDescription);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEnabled()).compareTo(other.isSetEnabled());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnabled()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enabled, other.enabled);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetDataMovementInterfaces())
            .compareTo(other.isSetDataMovementInterfaces());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataMovementInterfaces()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.dataMovementInterfaces, other.dataMovementInterfaces);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }