soda-angular
Version:
Socrata SODA client for Angular
19 lines (18 loc) • 623 B
JavaScript
import { Comparitor } from "./comparitor";
export class WhereFilter {
constructor(column, comparitor, value) {
if (value && Comparitor.isCheckingNull(comparitor)) {
throw new Error("Value must not be provided when using IsNull or IsNotNull comparitor");
}
this.Column = column;
this.Comparitor = comparitor;
this.Value = value;
}
toString() {
let clause = `${this.Column} ${this.Comparitor}`;
if (!Comparitor.isCheckingNull(this.Comparitor)) {
clause += ` ${this.Value}`;
}
return clause;
}
}