select-multiple-criterion.model.ts 545 Bytes
Newer Older
François Agneray's avatar
François Agneray committed
1
2
3
4
5
6
import { Criterion } from './criterion.model';
import { Option } from '../../../metamodel/model/option.model';

export class SelectMultipleCriterion extends Criterion {
    options: Option[];

Tifenn Guillas's avatar
Tifenn Guillas committed
7
    constructor(id: number, options: Option[]) {
François Agneray's avatar
François Agneray committed
8
9
10
11
12
13
14
15
16
        super(id);
        this.options = options;
    }

    printCriterion(): string {
        return '[' + this.options.map(option => option.label).join(',') + ']';
    }

    getCriterionStr(): string {
François Agneray's avatar
François Agneray committed
17
        return this.id + '::in::' + this.options.map(option => option.value).join('|');
François Agneray's avatar
François Agneray committed
18
19
    }
}