package com.bytedance.ies.nle.editor_jni;

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

public class NLEBranchListener {
    public transient boolean swigCMemOwn;
    public transient long swigCPtr;

    static {
        Covode.recordClassIndex(29776);
    }

    public void finalize() {
        delete();
    }

    public void swigDirectorDisconnect() {
        swigSetCMemOwn(false);
        delete();
    }

    public void onChanged() {
        MethodCollector.i(18572);
        NLEEditorJniJNI.NLEBranchListener_onChanged(this.swigCPtr, this);
        MethodCollector.o(18572);
    }

    public NLEBranchListener() {
        this(NLEEditorJniJNI.new_NLEBranchListener(), true);
        MethodCollector.i(18571);
        NLEEditorJniJNI.NLEBranchListener_director_connect(this, this.swigCPtr, true, true);
        MethodCollector.o(18571);
    }

    public void swigReleaseOwnership() {
        MethodCollector.i(18521);
        swigSetCMemOwn(false);
        NLEEditorJniJNI.NLEBranchListener_change_ownership(this, this.swigCPtr, false);
        MethodCollector.o(18521);
    }

    public void swigTakeOwnership() {
        MethodCollector.i(18570);
        swigSetCMemOwn(true);
        NLEEditorJniJNI.NLEBranchListener_change_ownership(this, this.swigCPtr, true);
        MethodCollector.o(18570);
    }

    public synchronized void delete() {
        MethodCollector.i(18481);
        long j = this.swigCPtr;
        if (j != 0) {
            if (this.swigCMemOwn) {
                this.swigCMemOwn = false;
                NLEEditorJniJNI.delete_NLEBranchListener(j);
            }
            this.swigCPtr = 0;
        }
        MethodCollector.o(18481);
    }

    public void swigSetCMemOwn(boolean z) {
        this.swigCMemOwn = z;
    }

    public static long getCPtr(NLEBranchListener nLEBranchListener) {
        if (nLEBranchListener == null) {
            return 0;
        }
        return nLEBranchListener.swigCPtr;
    }

    public NLEBranchListener(long j, boolean z) {
        this.swigCMemOwn = z;
        this.swigCPtr = j;
    }
}
