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