package com.seewo.vcommons.system.onoffsetting;

import a.b.c.a.a;
import android.database.Cursor;
import android.provider.BaseColumns;
import java.io.Serializable;
import java.util.Calendar;

/* JADX INFO: loaded from: classes.dex */
public class Task implements Serializable {
    private static final String DEFAULT_INVALID_DAYS = "0000000";
    public static final int INVALID_TIME = -1;
    private static final long serialVersionUID = 1;
    public String command;
    public String daysOfWeek;
    public boolean enabled;
    public String forceChannel;
    public int groupId;
    public int id;
    public String message;
    public String shutdownDays;
    public int shutdownHour;
    public int shutdownMinute;
    public String startupDays;
    public int startupHour;
    public int startupMinute;

    public static class TaskColumns implements BaseColumns {
        public static final int COLUMN_COUNT = 11;
        public static final String COMMAND = "command";
        public static final String DEFAULT_SORT_ORDER = "group_id ASC";
        public static final int TASK_COMMAND_INDEX = 10;
        public static final int TASK_CUSTOM_CLOUMN_FORCE_CHANNEL_INDEX = 12;
        public static final int TASK_DAYS_OF_WEEK_INDEX = 2;
        public static final int TASK_ENABLED_INDEX = 11;
        public static final int TASK_GROUP_ID_INDEX = 1;
        public static final int TASK_ID_INDEX = 0;
        public static final int TASK_MESSAGE_INDEX = 9;
        public static final int TASK_SHUTDOWN_DAYS_INDEX = 4;
        public static final int TASK_SHUTDOWN_HOUR_INDEX = 7;
        public static final int TASK_SHUTDOWN_MINUTES_INDEX = 8;
        public static final int TASK_STARTUP_DAYS_INDEX = 3;
        public static final int TASK_STARTUP_HOUR_INDEX = 5;
        public static final int TASK_STARTUP_MINUTES_INDEX = 6;
        public static final String WHERE_ENABLED = "enabled = 1 ";
        public static final String GROUP_ID = "group_id";
        public static final String DAYS_OF_WEEK = "daysofweek";
        public static final String STARTUP_DAYS = "startup_days";
        public static final String SHUTDOWN_DAYS = "shutdown_days";
        public static final String STARTUP_HOUR = "startup_hour";
        public static final String STARTUP_MINUTES = "startup_minutes";
        public static final String SHUTDOWN_HOUR = "shutdown_hour";
        public static final String SHUTDOWN_MINUTES = "shutdown_minutes";
        public static final String MESSAGE = "message";
        public static final String ENABLED = "enabled";
        public static final String CUSTOM_CLOUMN_FORCE_CHANNEL = "custom_force_channel";
        public static final String[] TASK_QUERY_COLUMNS = {"_id", GROUP_ID, DAYS_OF_WEEK, STARTUP_DAYS, SHUTDOWN_DAYS, STARTUP_HOUR, STARTUP_MINUTES, SHUTDOWN_HOUR, SHUTDOWN_MINUTES, MESSAGE, "command", ENABLED, CUSTOM_CLOUMN_FORCE_CHANNEL};

        private TaskColumns() {
        }
    }

    public Task() {
        this.id = -1;
        this.groupId = -1;
        this.startupHour = -1;
        this.startupMinute = -1;
        this.shutdownHour = -1;
        this.shutdownMinute = -1;
        this.daysOfWeek = DEFAULT_INVALID_DAYS;
        this.startupDays = DEFAULT_INVALID_DAYS;
        this.shutdownDays = DEFAULT_INVALID_DAYS;
        this.enabled = false;
        this.message = "";
        this.command = "";
        this.forceChannel = "";
    }

    public Task(int i2) {
        this.id = -1;
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        this.groupId = i2;
        this.startupHour = calendar.get(11);
        this.startupMinute = calendar.get(12);
        this.shutdownHour = -1;
        this.shutdownMinute = -1;
        this.daysOfWeek = DEFAULT_INVALID_DAYS;
        this.startupDays = DEFAULT_INVALID_DAYS;
        this.shutdownDays = DEFAULT_INVALID_DAYS;
        this.enabled = true;
        this.message = "";
        this.command = "";
        this.forceChannel = "";
    }

    public Task(Cursor cursor) {
        this.id = cursor.getInt(0);
        this.groupId = cursor.getInt(1);
        this.startupHour = cursor.getInt(5);
        this.startupMinute = cursor.getInt(6);
        this.shutdownHour = cursor.getInt(7);
        this.shutdownMinute = cursor.getInt(8);
        this.daysOfWeek = cursor.getString(2);
        this.startupDays = cursor.getString(3);
        this.shutdownDays = cursor.getString(4);
        this.enabled = cursor.getInt(11) == 1;
        this.message = cursor.getString(9);
        this.command = cursor.getString(10);
        this.forceChannel = cursor.getString(12);
    }

    public String toString() {
        StringBuilder sbC = a.C("ID: ");
        sbC.append(this.id);
        sbC.append(" GROUP_ID: ");
        sbC.append(this.groupId);
        sbC.append(" DAYS: ");
        sbC.append(this.daysOfWeek);
        sbC.append(" STARTUP_DAYS: ");
        sbC.append(this.startupDays);
        sbC.append(" SHUTDOWN_DAYS: ");
        sbC.append(this.shutdownDays);
        sbC.append(" STARTUP_HOUR: ");
        sbC.append(this.startupHour);
        sbC.append(" STARTUP_MINUTE: ");
        sbC.append(this.startupMinute);
        sbC.append(" SHUTDOWN_HOUR: ");
        sbC.append(this.shutdownHour);
        sbC.append(" SHUTDOWN_MINUTE: ");
        sbC.append(this.shutdownMinute);
        sbC.append(" ENABLED: ");
        sbC.append(this.enabled);
        sbC.append(" MESSAGE: ");
        sbC.append(this.message);
        sbC.append(" COMMAND: ");
        sbC.append(this.command);
        sbC.append(" FORCE_CHANNEL_NAME: ");
        sbC.append(this.forceChannel);
        return sbC.toString();
    }
}
