1 export class PgCategory {
2 static readonly CATEGORY_CLEAN = 'clean';
3 static readonly CATEGORY_WORKING = 'working';
4 static readonly CATEGORY_WARNING = 'warning';
5 static readonly CATEGORY_UNKNOWN = 'unknown';
6 static readonly VALID_CATEGORIES = [
7 PgCategory.CATEGORY_CLEAN,
8 PgCategory.CATEGORY_WORKING,
9 PgCategory.CATEGORY_WARNING,
10 PgCategory.CATEGORY_UNKNOWN
15 constructor(public type: string) {
16 if (!this.isValidType()) {
17 throw new Error('Wrong placement group category type');
23 private isValidType() {
24 return PgCategory.VALID_CATEGORIES.includes(this.type);
27 private setTypeStates() {
29 case PgCategory.CATEGORY_CLEAN:
30 this.states = ['active', 'clean'];
32 case PgCategory.CATEGORY_WORKING:
52 case PgCategory.CATEGORY_WARNING: