/*
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 * as tslib_1 from "tslib";
import { ValueType, toNullable, typeCast, Number_$type, markStruct } from "igniteui-angular-core";
import { ST_Percentage } from "./ST_Percentage";
import { DocCoreUtils } from "./DocCoreUtils";
/**
 * @hidden
 */
var ST_FixedPercentage = /** @class */ (function (_super) {
    tslib_1.__extends(ST_FixedPercentage, _super);
    function ST_FixedPercentage(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.d = new ST_Percentage();
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    DocCoreUtils.av(ST_FixedPercentage.$, ST_Percentage.l(c), "value", -100, 100);
                    _this.d = c;
                }
                break;
        }
        return _this;
    }
    ST_FixedPercentage.prototype.equals = function (a) {
        var 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());
    };
    ST_FixedPercentage.prototype.getHashCode = function () {
        return this.d.getHashCode();
    };
    ST_FixedPercentage.prototype.toString = function () {
        return this.s(1);
    };
    ST_FixedPercentage.prototype.s = function (a) {
        return this.d.r(a);
    };
    ST_FixedPercentage.c = function (a, b) {
        var c = ST_FixedPercentage.r(a, b);
        if (ST_FixedPercentage.j(c, toNullable(ST_FixedPercentage.$, null))) {
            return c.getValueOrDefault();
        }
        throw DocCoreUtils.n(ST_FixedPercentage.$, a);
    };
    ST_FixedPercentage.r = function (a, b) {
        return ST_FixedPercentage.p(ST_Percentage.q(a, b));
    };
    ST_FixedPercentage.g = function (a, b) {
        return ST_Percentage.e(a.d, b.d);
    };
    ST_FixedPercentage.h = function (a, b) {
        if (!a.hasValue) {
            return !b.hasValue;
        }
        else if (!b.hasValue) {
            return false;
        }
        return ST_FixedPercentage.g(a.value, b.value);
    };
    ST_FixedPercentage.i = function (a, b) {
        return !(ST_FixedPercentage.g(a, b));
    };
    ST_FixedPercentage.j = function (a, b) {
        if (!a.hasValue) {
            return b.hasValue;
        }
        else if (!b.hasValue) {
            return true;
        }
        return ST_FixedPercentage.i(a.value, b.value);
    };
    ST_FixedPercentage.a = function (a) {
        return new ST_FixedPercentage(1, a);
    };
    ST_FixedPercentage.p = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_FixedPercentage.$, null);
        }
        return toNullable(ST_FixedPercentage.$, ST_FixedPercentage.a(a.value));
    };
    ST_FixedPercentage.e = function (a) {
        return a.d;
    };
    ST_FixedPercentage.q = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_Percentage.$, null);
        }
        return toNullable(ST_Percentage.$, ST_FixedPercentage.e(a.value));
    };
    ST_FixedPercentage.m = function (a) {
        return ST_Percentage.l(a.d);
    };
    ST_FixedPercentage.o = function (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');
    return ST_FixedPercentage;
}(ValueType));
export { ST_FixedPercentage };
//# sourceMappingURL=ST_FixedPercentage.js.map