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