package com.bytedance.ies.nle.editor_jni;

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

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

    static {
        Covode.recordClassIndex(29843);
    }

    public void finalize() {
        delete();
    }

    public void swigDirectorDisconnect() {
        this.swigCMemOwn = false;
        delete();
    }

    public NLEResourceSynchronizer() {
        this(NLEEditorJniJNI.new_NLEResourceSynchronizer(), true);
        MethodCollector.i(15354);
        NLEEditorJniJNI.NLEResourceSynchronizer_director_connect(this, this.swigCPtr, true, true);
        MethodCollector.o(15354);
    }

    public void swigReleaseOwnership() {
        MethodCollector.i(14953);
        this.swigCMemOwn = false;
        NLEEditorJniJNI.NLEResourceSynchronizer_change_ownership(this, this.swigCPtr, false);
        MethodCollector.o(14953);
    }

    public void swigTakeOwnership() {
        MethodCollector.i(15158);
        this.swigCMemOwn = true;
        NLEEditorJniJNI.NLEResourceSynchronizer_change_ownership(this, this.swigCPtr, true);
        MethodCollector.o(15158);
    }

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

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

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

    public int fetch(String str, AnonymousClass4wp r10) {
        MethodCollector.i(15356);
        int NLEResourceSynchronizer_fetch = NLEEditorJniJNI.NLEResourceSynchronizer_fetch(this.swigCPtr, this, str, AnonymousClass4wp.LIZ(r10));
        MethodCollector.o(15356);
        return NLEResourceSynchronizer_fetch;
    }

    public int push(String str, AnonymousClass4wp r10) {
        MethodCollector.i(15530);
        int NLEResourceSynchronizer_push = NLEEditorJniJNI.NLEResourceSynchronizer_push(this.swigCPtr, this, str, AnonymousClass4wp.LIZ(r10));
        MethodCollector.o(15530);
        return NLEResourceSynchronizer_push;
    }
}
