import BadDataException from "../Exception/BadDataException";
import { ObjectType } from "../JSON";
import QueryOperator from "./QueryOperator";
export default class StartsWith 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.StartsWith,
            value: this.toString(),
        };
    }
    static fromJSON(json) {
        if (json["_type"] === ObjectType.StartsWith) {
            return new StartsWith(json["value"] || "");
        }
        throw new BadDataException("Invalid JSON: " + JSON.stringify(json));
    }
}
//# sourceMappingURL=StartsWith.js.map