import QueryOperator from "../BaseDatabase/QueryOperator";
import BadDataException from "../Exception/BadDataException";
import Typeof from "../Typeof";
export default class CompareBase extends QueryOperator {
    get value() {
        return this._value;
    }
    set value(v) {
        this._value = v;
    }
    constructor(value) {
        super();
        this.value = value;
    }
    toString() {
        return this.value.toString();
    }
    toNumber() {
        if (Typeof.Number === typeof this.value) {
            return this.value;
        }
        throw new BadDataException("Value is not a number");
    }
    toDate() {
        if (this.value instanceof Date) {
            return this.value;
        }
        throw new BadDataException("Value is not a date object");
    }
}
//# sourceMappingURL=CompareBase.js.map