package com.mstar.android.tvapi.dtv.vo;

import android.os.Parcel;
import android.os.Parcelable;
import com.mstar.android.tvapi.common.exception.TvOutOfBoundException;
import java.util.Hashtable;
import okhttp3.HttpUrl;

/* JADX INFO: loaded from: classes.dex */
public class EpgEventInfo implements Parcelable {
    public String description;
    public int durationTime;
    public int endTime;
    public int eventId;
    protected int functionStatus;
    public short genre;
    public boolean isScrambled;
    public String name;
    public int originalStartTime;
    public short parentalRating;
    public int startTime;
    private static Hashtable<Integer, Integer> enumhash = new Hashtable<>();
    public static final Parcelable.Creator<EpgEventInfo> CREATOR = new Parcelable.Creator<EpgEventInfo>() { // from class: com.mstar.android.tvapi.dtv.vo.EpgEventInfo.1
        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public EpgEventInfo createFromParcel(Parcel parcel) {
            return new EpgEventInfo(parcel);
        }

        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public EpgEventInfo[] newArray(int i2) {
            return new EpgEventInfo[i2];
        }
    };

    public enum EnumEpgFunctionStatus {
        E_EPG_FUNC_STATUS_SUCCESS(0),
        E_EPG_FUNC_STATUS_INVALID(1),
        E_EPG_FUNC_STATUS_NO_EVENT(2),
        E_EPG_FUNC_STATUS_NO_STRING(3),
        E_EPG_FUNC_STATUS_NO_CHANNEL(4),
        E_EPG_FUNC_STATUS_CRID_NOT_FOUND(5),
        E_EPG_FUNC_STATUS_DB_NO_CONNECT(10),
        E_EPG_FUNC_STATUS_DB_NO_LOCK(11),
        E_EPG_FUNC_STATUS_DB_NO_CHANNEL_DB(12),
        E_EPG_FUNC_STATUS_NO_FUNCTION(255);

        private static int seq = 0;
        private final int value;

        EnumEpgFunctionStatus(int i2) {
            this.value = i2;
            setHashtableValue(i2);
        }

        public static int getOrdinalThroughValue(int i2) throws TvOutOfBoundException {
            Integer num = (Integer) EpgEventInfo.enumhash.get(Integer.valueOf(i2));
            if (num != null) {
                return num.intValue();
            }
            throw new TvOutOfBoundException();
        }

        private static void setHashtableValue(int i2) {
            EpgEventInfo.enumhash.put(new Integer(i2), new Integer(seq));
            seq++;
        }

        public int getValue() {
            return this.value;
        }
    }

    public EpgEventInfo() {
        this.startTime = 0;
        this.endTime = 0;
        this.durationTime = 0;
        this.name = HttpUrl.FRAGMENT_ENCODE_SET;
        this.eventId = 0;
        this.isScrambled = false;
        this.genre = (short) 0;
        this.parentalRating = (short) 0;
        this.description = HttpUrl.FRAGMENT_ENCODE_SET;
        this.originalStartTime = 0;
        this.functionStatus = 0;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    public EnumEpgFunctionStatus getEpgFunctionStatus() throws TvOutOfBoundException {
        return EnumEpgFunctionStatus.values()[EnumEpgFunctionStatus.getOrdinalThroughValue(this.functionStatus)];
    }

    public void setEpgFunctionStatus(EnumEpgFunctionStatus enumEpgFunctionStatus) {
        this.functionStatus = enumEpgFunctionStatus.getValue();
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i2) {
        parcel.writeInt(this.startTime);
        parcel.writeInt(this.endTime);
        parcel.writeInt(this.durationTime);
        parcel.writeString(this.name);
        parcel.writeInt(this.eventId);
        parcel.writeInt(this.isScrambled ? 1 : 0);
        parcel.writeInt(this.genre);
        parcel.writeInt(this.parentalRating);
        parcel.writeString(this.description);
        parcel.writeInt(this.originalStartTime);
        parcel.writeInt(this.functionStatus);
    }

    public EpgEventInfo(Parcel parcel) {
        this.startTime = parcel.readInt();
        this.endTime = parcel.readInt();
        this.durationTime = parcel.readInt();
        this.name = parcel.readString();
        this.eventId = parcel.readInt();
        this.isScrambled = parcel.readInt() == 1;
        this.genre = (short) parcel.readInt();
        this.parentalRating = (short) parcel.readInt();
        this.description = parcel.readString();
        this.originalStartTime = parcel.readInt();
        this.functionStatus = parcel.readInt();
    }
}
