package com.bytedance.ies.nle.editor_jni;

import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public class NLEMonitor {
    public transient boolean LIZ;
    public transient long LIZIZ;

    static {
        Covode.recordClassIndex(29826);
    }

    public void finalize() {
        LIZIZ();
    }

    public NLEMonitor() {
        this(NLEEditorJniJNI.new_NLEMonitor(), true);
        MethodCollector.i(18452);
        MethodCollector.o(18452);
    }

    public static NLEMonitor LIZ() {
        MethodCollector.i(18454);
        long NLEMonitor_obtain = NLEEditorJniJNI.NLEMonitor_obtain();
        if (NLEMonitor_obtain == 0) {
            MethodCollector.o(18454);
            return null;
        }
        NLEMonitor nLEMonitor = new NLEMonitor(NLEMonitor_obtain, false);
        MethodCollector.o(18454);
        return nLEMonitor;
    }

    private synchronized void LIZIZ() {
        MethodCollector.i(18451);
        long j = this.LIZIZ;
        if (j != 0) {
            if (this.LIZ) {
                this.LIZ = false;
                NLEEditorJniJNI.delete_NLEMonitor(j);
            }
            this.LIZIZ = 0;
        }
        MethodCollector.o(18451);
    }

    public NLEMonitor(long j, boolean z) {
        this.LIZ = z;
        this.LIZIZ = j;
    }

    public final void LIZ(String str, int i, String str2, long j) {
        MethodCollector.i(18456);
        NLEEditorJniJNI.NLEMonitor_onEvent__SWIG_0(this.LIZIZ, this, str, i, str2, j);
        MethodCollector.o(18456);
    }
}
