package com.tencent.mm.modelsfs;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.HashMap;
import java.util.Map.Entry;

public class SFSContext$Builder implements Parcelable {
    public static final Creator<SFSContext$Builder> CREATOR = new 1();
    HashMap<Integer, Object> mConf;
    String mName;

    public SFSContext$Builder setName(String str) {
        this.mName = str;
        return this;
    }

    public SFSContext$Builder setIndexDBPath(String str) {
        AppMethodBeat.i(93214);
        this.mConf.put(Integer.valueOf(1), str);
        AppMethodBeat.o(93214);
        return this;
    }

    public SFSContext$Builder setBlockFilePrefix(String str) {
        AppMethodBeat.i(93215);
        this.mConf.put(Integer.valueOf(2), str);
        AppMethodBeat.o(93215);
        return this;
    }

    public SFSContext$Builder setOverflowPrefix(String str) {
        AppMethodBeat.i(93216);
        this.mConf.put(Integer.valueOf(3), str);
        AppMethodBeat.o(93216);
        return this;
    }

    public SFSContext$Builder setIOMode(int i) {
        AppMethodBeat.i(93217);
        this.mConf.put(Integer.valueOf(9), Integer.valueOf(i));
        AppMethodBeat.o(93217);
        return this;
    }

    public SFSContext$Builder setBlockSizeArray(int[] iArr) {
        AppMethodBeat.i(93218);
        this.mConf.put(Integer.valueOf(5), iArr);
        AppMethodBeat.o(93218);
        return this;
    }

    public SFSContext$Builder setBlockFileMaxSize(int i) {
        AppMethodBeat.i(93219);
        this.mConf.put(Integer.valueOf(4), Integer.valueOf(i));
        AppMethodBeat.o(93219);
        return this;
    }

    public SFSContext$Builder setConnectionPool(int i) {
        AppMethodBeat.i(93220);
        this.mConf.put(Integer.valueOf(7), Integer.valueOf(i));
        AppMethodBeat.o(93220);
        return this;
    }

    public SFSContext$Builder setMaxConcurrentIO(int i) {
        AppMethodBeat.i(93221);
        this.mConf.put(Integer.valueOf(10), Integer.valueOf(i));
        AppMethodBeat.o(93221);
        return this;
    }

    public SFSContext$Builder setSyncMode(int i) {
        AppMethodBeat.i(93222);
        this.mConf.put(Integer.valueOf(11), Integer.valueOf(i));
        AppMethodBeat.o(93222);
        return this;
    }

    public SFSContext$Builder setStoragePath(String str) {
        AppMethodBeat.i(93223);
        if (str.endsWith("/")) {
            str = str.substring(0, str.length() - 1);
        }
        this.mConf.put(Integer.valueOf(2), str + "/%s.block");
        this.mConf.put(Integer.valueOf(3), str + "/%s/");
        AppMethodBeat.o(93223);
        return this;
    }

    public SFSContext$Builder setDBDirectory(String str) {
        AppMethodBeat.i(93224);
        if (str.endsWith("/")) {
            str = str.substring(0, str.length() - 1);
        }
        this.mConf.put(Integer.valueOf(1), str + "/%s.index");
        AppMethodBeat.o(93224);
        return this;
    }

    public SFSContext$Builder() {
        AppMethodBeat.i(93225);
        this.mName = null;
        this.mConf = new HashMap();
        AppMethodBeat.o(93225);
    }

    public SFSContext create() {
        AppMethodBeat.i(93226);
        SFSContext sFSContext = new SFSContext(this, (byte) 0);
        AppMethodBeat.o(93226);
        return sFSContext;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        AppMethodBeat.i(93227);
        parcel.writeString(this.mName);
        Object[] objArr = new Object[12];
        for (Entry entry : this.mConf.entrySet()) {
            int intValue = ((Integer) entry.getKey()).intValue();
            if (intValue < 12 && intValue >= 0) {
                objArr[intValue] = entry.getValue();
            }
        }
        parcel.writeArray(objArr);
        AppMethodBeat.o(93227);
    }

    static {
        AppMethodBeat.i(93229);
        AppMethodBeat.o(93229);
    }

    private SFSContext$Builder(Parcel parcel) {
        AppMethodBeat.i(93228);
        this.mName = parcel.readString();
        this.mConf = new HashMap();
        Object[] readArray = parcel.readArray(SFSContext$Builder.class.getClassLoader());
        if (readArray != null) {
            for (int i = 0; i < readArray.length; i++) {
                if (readArray[i] != null) {
                    this.mConf.put(Integer.valueOf(i), readArray[i]);
                }
            }
        }
        AppMethodBeat.o(93228);
    }
}
