package com.kfzs.duanduan.datashare.provider.records;

// @formatter:off
import android.net.Uri;
import android.provider.BaseColumns;

import com.kfzs.duanduan.datashare.provider.KFZSDDProvider;
import com.kfzs.duanduan.datashare.provider.base.AbstractSelection;
import com.kfzs.duanduan.datashare.provider.downloadtask.DownloadtaskColumns;
import com.kfzs.duanduan.datashare.provider.records.RecordsColumns;
import com.kfzs.duanduan.datashare.provider.session.SessionColumns;

/**
 * A records info which is part of a team.
 */
@SuppressWarnings("unused")
public class RecordsColumns implements BaseColumns {
    public static final String TABLE_NAME = "records";
    public static final Uri CONTENT_URI = Uri.parse(KFZSDDProvider.CONTENT_URI_BASE + "/" + TABLE_NAME);

    /**
     * Primary key.
     */
    public static final String _ID = BaseColumns._ID;

    /**
     * update create_time of this records.
     */
    public static final String CREATE_TIME = "create_time";

    /**
     * name of this records.
     */
    public static final String NAME = "name";


    public static final String DEFAULT_ORDER = TABLE_NAME + "." + NAME + AbstractSelection.DESC;

    public static final String[] ALL_COLUMNS = new String[] {
            _ID,
            CREATE_TIME,
            NAME
    };

    public static boolean hasColumns(String[] projection) {
        if (projection == null) return true;
        for (String c : projection) {
            if (c.equals(CREATE_TIME) || c.contains("." + CREATE_TIME)) return true;
            if (c.equals(NAME) || c.contains("." + NAME)) return true;
        }
        return false;
    }

}
