bool MessageAck::equals()

in activemq-cpp/src/main/activemq/commands/MessageAck.cpp [179:243]


bool MessageAck::equals(const DataStructure* value) const {

    if (this == value) {
        return true;
    }

    const MessageAck* valuePtr = dynamic_cast<const MessageAck*>(value);

    if (valuePtr == NULL || value == NULL) {
        return false;
    }

    if (this->getDestination() != NULL) {
        if (!this->getDestination()->equals(valuePtr->getDestination().get())) {
            return false;
        }
    } else if (valuePtr->getDestination() != NULL) {
        return false;
    }
    if (this->getTransactionId() != NULL) {
        if (!this->getTransactionId()->equals(valuePtr->getTransactionId().get())) {
            return false;
        }
    } else if (valuePtr->getTransactionId() != NULL) {
        return false;
    }
    if (this->getConsumerId() != NULL) {
        if (!this->getConsumerId()->equals(valuePtr->getConsumerId().get())) {
            return false;
        }
    } else if (valuePtr->getConsumerId() != NULL) {
        return false;
    }
    if (this->getAckType() != valuePtr->getAckType()) {
        return false;
    }
    if (this->getFirstMessageId() != NULL) {
        if (!this->getFirstMessageId()->equals(valuePtr->getFirstMessageId().get())) {
            return false;
        }
    } else if (valuePtr->getFirstMessageId() != NULL) {
        return false;
    }
    if (this->getLastMessageId() != NULL) {
        if (!this->getLastMessageId()->equals(valuePtr->getLastMessageId().get())) {
            return false;
        }
    } else if (valuePtr->getLastMessageId() != NULL) {
        return false;
    }
    if (this->getMessageCount() != valuePtr->getMessageCount()) {
        return false;
    }
    if (this->getPoisonCause() != NULL) {
        if (!this->getPoisonCause()->equals(valuePtr->getPoisonCause().get())) {
            return false;
        }
    } else if (valuePtr->getPoisonCause() != NULL) {
        return false;
    }
    if (!BaseCommand::equals(value)) {
        return false;
    }
    return true;
}