import CompareBase from "../Database/CompareBase";
import BadDataException from "../Exception/BadDataException";
import { ObjectType } from "../JSON";
export default class EqualToOrNull extends CompareBase {
    constructor(value) {
        super(value);
        this.value = value;
    }
    toString() {
        return this.value.toString();
    }
    toJSON() {
        return {
            _type: ObjectType.EqualToOrNull,
            value: this.toString(),
        };
    }
    static fromJSON(json) {
        if (json["_type"] === ObjectType.EqualToOrNull) {
            return new EqualToOrNull(json["value"]);
        }
        throw new BadDataException("Invalid JSON: " + JSON.stringify(json));
    }
}
//# sourceMappingURL=EqualToOrNull.js.map