1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 export enum FilterField {
7 OWNER_UUID = "owner_uuid"
10 export default class FilterBuilder {
13 private addCondition(field: FilterField, cond: string, value?: string, prefix: string = "", postfix: string = "") {
15 this.filters += `["${field}","${cond}","${prefix}${value}${postfix}"]`;
20 public addEqual(field: FilterField, value?: string) {
21 return this.addCondition(field, "=", value);
24 public addLike(field: FilterField, value?: string) {
25 return this.addCondition(field, "like", value, "", "%");
28 public addILike(field: FilterField, value?: string) {
29 return this.addCondition(field, "ilike", value, "", "%");
33 return "[" + this.filters + "]";