aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/model/ModelExtensions.ts
blob: 9fcba7f1ce11f50e182c25125e03325ae8180a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { AttributeParameters, Brush, MarginAggregateParameters, SingleDimensionAggregateParameters, Solution } from '../model/idea/idea'
import { Utils } from '../utils/Utils'

import { FilterModel } from '../core/filter/FilterModel'

(SingleDimensionAggregateParameters as any).prototype["Equals"] = function (other: Object) {
    if (!Utils.EqualityHelper(this, other)) return false;
    if (!Utils.EqualityHelper((this as SingleDimensionAggregateParameters).attributeParameters!,
        (other as SingleDimensionAggregateParameters).attributeParameters!)) return false;
    if (!((this as SingleDimensionAggregateParameters).attributeParameters! as any)["Equals"]((other as SingleDimensionAggregateParameters).attributeParameters)) return false;
    return true;
}

{
    (AttributeParameters as any).prototype["Equals"] = function (other: AttributeParameters) {
        return (<any>this).constructor.name === (<any>other).constructor.name &&
            this.rawName === other.rawName;
    }
}

{
    (Solution as any).prototype["Equals"] = function (other: Object) {
        if (!Utils.EqualityHelper(this, other)) return false;
        if ((this as Solution).solutionId !== (other as Solution).solutionId) return false;
        return true;
    }
}

{
    (MarginAggregateParameters as any).prototype["Equals"] = function (other: Object) {
        if (!Utils.EqualityHelper(this, other)) return false;
        if (!Utils.EqualityHelper((this as SingleDimensionAggregateParameters).attributeParameters!,
            (other as SingleDimensionAggregateParameters).attributeParameters!)) return false;
        if (!((this as SingleDimensionAggregateParameters).attributeParameters! as any)["Equals"]((other as SingleDimensionAggregateParameters).attributeParameters!)) return false;

        if ((this as MarginAggregateParameters).aggregateFunction !== (other as MarginAggregateParameters).aggregateFunction) return false;
        return true;
    }
}

{
    (Brush as any).prototype["Equals"] = function (other: Object) {
        if (!Utils.EqualityHelper(this, other)) return false;
        if ((this as Brush).brushEnum !== (other as Brush).brushEnum) return false;
        if ((this as Brush).brushIndex !== (other as Brush).brushIndex) return false;
        return true;
    }
}