"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cast_de_nrw_schule_svws_logger_LogConsumerConsole = exports.LogConsumerConsole = void 0;
const JavaObject_1 = require("../java/lang/JavaObject");
class LogConsumerConsole extends JavaObject_1.JavaObject {
    printTime;
    printLevel;
    /**
     * Implementation for method overloads of 'constructor'
     */
    constructor(__param0, __param1) {
        super();
        if ((typeof __param0 === "undefined") && (typeof __param1 === "undefined")) {
            this.printTime = false;
            this.printLevel = false;
        }
        else if (((typeof __param0 !== "undefined") && typeof __param0 === "boolean") && ((typeof __param1 !== "undefined") && typeof __param1 === "boolean")) {
            let printTime = __param0;
            let printLevel = __param1;
            this.printTime = printTime;
            this.printLevel = printLevel;
        }
        else
            throw new Error('invalid method overload');
    }
    /**
     * Diese Methode implementiert das funktionale Interface java.util.function.Consumer
     * und gibt die empfangenen Log-Informationen auf der Kommandozeile aus.
     *
     * @param t   die auszugebenden Log-Informationen
     */
    accept(t) {
        if (t === null)
            return;
        let s = (this.printTime ? t.getTime() + " " : "") + (this.printLevel ? t.getLevel() + " " : "") + t.getText().valueOf();
        if (t.isNewLine())
            console.log(JSON.stringify(s));
        else
            console.log(JSON.stringify(s));
    }
    isTranspiledInstanceOf(name) {
        return ['de.nrw.schule.svws.logger.LogConsumerConsole', 'java.util.function.Consumer'].includes(name);
    }
}
exports.LogConsumerConsole = LogConsumerConsole;
function cast_de_nrw_schule_svws_logger_LogConsumerConsole(obj) {
    return obj;
}
exports.cast_de_nrw_schule_svws_logger_LogConsumerConsole = cast_de_nrw_schule_svws_logger_LogConsumerConsole;
//# sourceMappingURL=LogConsumerConsole.js.map