/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { ValueType, toNullable, typeCast, Number_$type, markStruct } from "igniteui-angular-core";
import { ST_Percentage } from "./ST_Percentage";
import { DocCoreUtils } from "./DocCoreUtils";
/**
 * @hidden
 */
export class ST_FixedPercentage extends ValueType {
    constructor(a, ..._rest) {
        super();
        this.d = new ST_Percentage();
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    let c = _rest[0];
                    DocCoreUtils.av(ST_FixedPercentage.$, ST_Percentage.l(c), "value", -100, 100);
                    this.d = c;
                }
                break;
        }
    }
    equals(a) {
        let b = toNullable(ST_FixedPercentage.$, typeCast(ST_FixedPercentage.$, a));
        if (ST_FixedPercentage.j(b, toNullable(ST_FixedPercentage.$, null))) {
            return false;
        }
        return ST_FixedPercentage.g(this, b.getValueOrDefault());
    }
    getHashCode() {
        return this.d.getHashCode();
    }
    toString() {
        return this.s(1);
    }
    s(a) {
        return this.d.r(a);
    }
    static c(a, b) {
        let c = ST_FixedPercentage.r(a, b);
        if (ST_FixedPercentage.j(c, toNullable(ST_FixedPercentage.$, null))) {
            return c.getValueOrDefault();
        }
        throw DocCoreUtils.n(ST_FixedPercentage.$, a);
    }
    static r(a, b) {
        return ST_FixedPercentage.p(ST_Percentage.q(a, b));
    }
    static g(a, b) {
        return ST_Percentage.e(a.d, b.d);
    }
    static h(a, b) {
        if (!a.hasValue) {
            return !b.hasValue;
        }
        else if (!b.hasValue) {
            return false;
        }
        return ST_FixedPercentage.g(a.value, b.value);
    }
    static i(a, b) {
        return !(ST_FixedPercentage.g(a, b));
    }
    static j(a, b) {
        if (!a.hasValue) {
            return b.hasValue;
        }
        else if (!b.hasValue) {
            return true;
        }
        return ST_FixedPercentage.i(a.value, b.value);
    }
    static a(a) {
        return new ST_FixedPercentage(1, a);
    }
    static p(a) {
        if (!a.hasValue) {
            return toNullable(ST_FixedPercentage.$, null);
        }
        return toNullable(ST_FixedPercentage.$, ST_FixedPercentage.a(a.value));
    }
    static e(a) {
        return a.d;
    }
    static q(a) {
        if (!a.hasValue) {
            return toNullable(ST_Percentage.$, null);
        }
        return toNullable(ST_Percentage.$, ST_FixedPercentage.e(a.value));
    }
    static m(a) {
        return ST_Percentage.l(a.d);
    }
    static o(a) {
        if (!a.hasValue) {
            return toNullable(Number_$type, null);
        }
        return toNullable(Number_$type, ST_FixedPercentage.m(a.value));
    }
}
ST_FixedPercentage.$t = markStruct(ST_FixedPercentage, 'ST_FixedPercentage');
//# sourceMappingURL=ST_FixedPercentage.js.map