package guard.api.sensitive.ui.sapiguard;

import android.os.Parcel;
import android.os.Parcelable;

public class SensitiveApiRecord implements Parcelable {

    public int id;
    public String stacktrace;
    public int hascode;
    public String mtdsig;
    public int times;
    public String topAty;

    public SensitiveApiRecord(Parcel other) {
        id = other.readInt();
        stacktrace = other.readString();
        hascode = other.readInt();
        mtdsig = other.readString();
        times = other.readInt();
        topAty = other.readString();
    }

    public SensitiveApiRecord(int _id, String _stacktrace, int _hascode, String _mtdsig, int _times, String _topAty) {
        id = _id;
        stacktrace = _stacktrace;
        hascode = _hascode;
        mtdsig = _mtdsig;
        times = _times;
        topAty = _topAty;
    }

    public static final Parcelable.Creator<SensitiveApiRecord> CREATOR = new Parcelable.Creator<SensitiveApiRecord>() {
        public SensitiveApiRecord createFromParcel(Parcel in) {
            return new SensitiveApiRecord(in);
        }

        public SensitiveApiRecord[] newArray(int size) {
            return new SensitiveApiRecord[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(stacktrace);
        dest.writeInt(hascode);
        dest.writeString(mtdsig);
        dest.writeInt(times);
        dest.writeString(topAty);
    }


    @Override
    public String toString() {
        return "SensitiveApiRecord{" +
                "id=" + id +
                ", stacktrace='" + stacktrace + '\'' +
                ", hascode=" + hascode +
                ", mtdsig='" + mtdsig + '\'' +
                ", times=" + times + '\'' +
                ", topAty=" + topAty +
                '}';
    }
}
