"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageRef = void 0;
const validations_1 = require("./validations");
class MessageRef {
    timestamp;
    sequenceNumber;
    constructor(timestamp, sequenceNumber) {
        (0, validations_1.validateIsNotNegativeInteger)('timestamp', timestamp);
        (0, validations_1.validateIsNotNegativeInteger)('sequenceNumber', sequenceNumber, true);
        this.timestamp = timestamp;
        this.sequenceNumber = sequenceNumber;
    }
    compareTo(other) {
        if (this.timestamp < other.timestamp) {
            return -1;
        }
        if (this.timestamp > other.timestamp) {
            return 1;
        }
        if (this.sequenceNumber < other.sequenceNumber) {
            return -1;
        }
        if (this.sequenceNumber > other.sequenceNumber) {
            return 1;
        }
        return 0;
    }
}
exports.MessageRef = MessageRef;
//# sourceMappingURL=MessageRef.js.map