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