/*
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_TextPointUnqualified } from "./ST_TextPointUnqualified";
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_TextPoint extends ValueType {
    constructor(a, ..._rest) {
        super();
        this.b = toNullable(ST_TextPointUnqualified.$, null);
        this.c = toNullable(ST_UniversalMeasure.$, null);
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    let c = _rest[0];
                    this.b = toNullable(ST_TextPointUnqualified.$, c);
                    this.c = toNullable(ST_UniversalMeasure.$, null);
                }
                break;
            case 2:
                {
                    let c = _rest[0];
                    this.b = toNullable(ST_TextPointUnqualified.$, null);
                    this.c = toNullable(ST_UniversalMeasure.$, c);
                }
                break;
        }
    }
    toString() {
        if (nullableNotEquals(this.b, null)) {
            return this.b.toString();
        }
        if (ST_UniversalMeasure.f(this.c, toNullable(ST_UniversalMeasure.$, null))) {
            return this.c.toString();
        }
        return stringEmpty();
    }
    static a(a) {
        let b = ST_TextPointUnqualified.i(a);
        if (nullableNotEquals(b, null)) {
            return new ST_TextPoint(1, b.value);
        }
        let c = ST_UniversalMeasure.o(a);
        if (ST_UniversalMeasure.f(c, toNullable(ST_UniversalMeasure.$, null))) {
            return new ST_TextPoint(2, c.value);
        }
        throw DocCoreUtils.n(ST_TextPoint.$, a);
    }
}
ST_TextPoint.$t = markStruct(ST_TextPoint, 'ST_TextPoint');
//# sourceMappingURL=ST_TextPoint.js.map