/*
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, markStruct } from "igniteui-angular-core";
import { ST_Coordinate32Unqualified } from "./ST_Coordinate32Unqualified";
import { ST_UniversalMeasure } from "./ST_UniversalMeasure";
import { DocCoreUtils } from "./DocCoreUtils";
import { nullableNotEquals } from "igniteui-angular-core";
import { stringEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
export class ST_Coordinate32 extends ValueType {
    constructor(a, ..._rest) {
        super();
        this.k = toNullable(ST_Coordinate32Unqualified.$, null);
        this.l = toNullable(ST_UniversalMeasure.$, null);
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    let c = _rest[0];
                    this.k = toNullable(ST_Coordinate32Unqualified.$, c);
                    this.l = toNullable(ST_UniversalMeasure.$, null);
                }
                break;
            case 2:
                {
                    let c = _rest[0];
                    this.k = toNullable(ST_Coordinate32Unqualified.$, null);
                    this.l = toNullable(ST_UniversalMeasure.$, c);
                }
                break;
        }
    }
    j() {
        if (nullableNotEquals(this.k, null)) {
            return this.k.value.g;
        }
        if (ST_UniversalMeasure.f(this.l, toNullable(ST_UniversalMeasure.$, null))) {
            return this.l.value.m();
        }
        return 0;
    }
    static g(a) {
        let b = ST_Coordinate32.q(a);
        if (nullableNotEquals(b, null)) {
            return b.getValueOrDefault();
        }
        throw DocCoreUtils.n(ST_Coordinate32.$, a);
    }
    static q(a) {
        let b = ST_Coordinate32Unqualified.j(a);
        if (nullableNotEquals(b, null)) {
            return toNullable(ST_Coordinate32.$, ST_Coordinate32.b(b.getValueOrDefault()));
        }
        let c = ST_UniversalMeasure.o(a);
        if (ST_UniversalMeasure.f(c, toNullable(ST_UniversalMeasure.$, null))) {
            return toNullable(ST_Coordinate32.$, ST_Coordinate32.c(c.getValueOrDefault()));
        }
        return toNullable(ST_Coordinate32.$, null);
    }
    toString() {
        if (nullableNotEquals(this.k, null)) {
            return this.k.getValueOrDefault().toString();
        }
        if (ST_UniversalMeasure.f(this.l, toNullable(ST_UniversalMeasure.$, null))) {
            return this.l.getValueOrDefault().toString();
        }
        return stringEmpty();
    }
    static a(a) {
        return new ST_Coordinate32(1, ST_Coordinate32Unqualified.a(a));
    }
    static n(a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate32.$, null);
        }
        return toNullable(ST_Coordinate32.$, ST_Coordinate32.a(a.value));
    }
    static b(a) {
        return new ST_Coordinate32(1, a);
    }
    static o(a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate32.$, null);
        }
        return toNullable(ST_Coordinate32.$, ST_Coordinate32.b(a.value));
    }
    static h(a) {
        return a.k.value;
    }
    static m(a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate32Unqualified.$, null);
        }
        return toNullable(ST_Coordinate32Unqualified.$, ST_Coordinate32.h(a.value));
    }
    static c(a) {
        return new ST_Coordinate32(2, a);
    }
    static p(a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate32.$, null);
        }
        return toNullable(ST_Coordinate32.$, ST_Coordinate32.c(a.value));
    }
}
ST_Coordinate32.$t = markStruct(ST_Coordinate32, 'ST_Coordinate32');
//# sourceMappingURL=ST_Coordinate32.js.map