@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); } } } }
/** 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; } }
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 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; }