// Path: app/src/main/java/com/jachness/blockcalls/db/LogTable.java
// public class LogTable {
// 
//     public static final String RELATIVE_PATH = "log";
//     public static final String TABLE = "log";
// 
//     public static final String UID = "_id";
//     public static final String CALLER_ID = "caller_id";
//     public static final String DISPLAY_NUMBER = "display_number";
//     public static final String DISPLAY_NAME = "display_name";
//     public static final String DATE = "date";
//     public static final String BLOCK_ORIGIN = "block_origin";
// 
//     public static final Uri CONTENT_URI = Uri.parse("content://" + LogProvider.AUTHORITY + "/" +
//             RELATIVE_PATH);
// 
//     public static final String CONTENT_TYPE = "vnd.android.cursor.dir/" + RELATIVE_PATH;
//     public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/" + RELATIVE_PATH;
// 
//     public static final int SSID_PATH_POSITION = 1;
// 
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/stuff/BlockOrigin.java
// public enum BlockOrigin {
//     PRIVATE, CONTACTS, BLACK_LIST
// }


import android.content.ContentValues;
import android.database.Cursor;
import android.support.annotation.NonNull;
import com.jachness.blockcalls.db.LogTable;
import com.jachness.blockcalls.stuff.BlockOrigin;
/*
 * Copyright (C) 2017 Jonatan Cheiro Anriquez
 *
 * This file is part of Block Calls.
 *
 * Block Calls is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Block Calls is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Block Calls. If not, see <http://www.gnu.org/licenses/>.
 */

package com.jachness.blockcalls.entities;



public class LogEntity {
    private Long uid;
    private String callerID;
    private String displayNumber;
    private String displayName;
    private long time;
    private BlockOrigin blockOrigin;

    public LogEntity() {
    }

    public LogEntity(Cursor cur) {
        for (String colName : cur.getColumnNames()) {
            int colIndex = cur.getColumnIndexOrThrow(colName);
            switch (colName) {
                case LogTable.CALLER_ID:
                    this.setCallerID(cur.getString(colIndex));
                    break;
                case LogTable.DISPLAY_NUMBER:
                    this.setDisplayNumber(cur.getString(colIndex));
                    break;
                case LogTable.DATE:
                    this.setTime(cur.getLong(colIndex));
                    break;
                case LogTable.BLOCK_ORIGIN:
                    this.setBlockOrigin(BlockOrigin.valueOf(cur.getString(colIndex)));
                    break;
                case LogTable.UID:
                    this.setUid(cur.getLong(colIndex));
                    break;
// Path: app/src/main/java/com/jachness/blockcalls/db/LogTable.java
// public class LogTable {
// 
//     public static final String RELATIVE_PATH = "log";
//     public static final String TABLE = "log";
// 
//     public static final String UID = "_id";
//     public static final String CALLER_ID = "caller_id";
//     public static final String DISPLAY_NUMBER = "display_number";
//     public static final String DISPLAY_NAME = "display_name";
//     public static final String DATE = "date";
//     public static final String BLOCK_ORIGIN = "block_origin";
// 
//     public static final Uri CONTENT_URI = Uri.parse("content://" + LogProvider.AUTHORITY + "/" +
//             RELATIVE_PATH);
// 
//     public static final String CONTENT_TYPE = "vnd.android.cursor.dir/" + RELATIVE_PATH;
//     public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/" + RELATIVE_PATH;
// 
//     public static final int SSID_PATH_POSITION = 1;
// 
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/stuff/BlockOrigin.java
// public enum BlockOrigin {
//     PRIVATE, CONTACTS, BLACK_LIST
// }


// Path: app/src/main/java/com/jachness/blockcalls/entities/LogEntity.java
import android.content.ContentValues;
import android.database.Cursor;
import android.support.annotation.NonNull;
import com.jachness.blockcalls.db.LogTable;
import com.jachness.blockcalls.stuff.BlockOrigin;

/*
 * Copyright (C) 2017 Jonatan Cheiro Anriquez
 *
 * This file is part of Block Calls.
 *
 * Block Calls is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Block Calls is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Block Calls. If not, see <http://www.gnu.org/licenses/>.
 */

package com.jachness.blockcalls.entities;



public class LogEntity {
    private Long uid;
    private String callerID;
    private String displayNumber;
    private String displayName;
    private long time;
    private BlockOrigin blockOrigin;

    public LogEntity() {
    }

    public LogEntity(Cursor cur) {
        for (String colName : cur.getColumnNames()) {
            int colIndex = cur.getColumnIndexOrThrow(colName);
            switch (colName) {
                case LogTable.CALLER_ID:
                    this.setCallerID(cur.getString(colIndex));
                    break;
                case LogTable.DISPLAY_NUMBER:
                    this.setDisplayNumber(cur.getString(colIndex));
                    break;
                case LogTable.DATE:
                    this.setTime(cur.getLong(colIndex));
                    break;
                case LogTable.BLOCK_ORIGIN:
                    this.setBlockOrigin(BlockOrigin.valueOf(cur.getString(colIndex)));
                    break;
                case LogTable.UID:
                    this.setUid(cur.getLong(colIndex));
                    break;
                case LogTable.DISPLAY_NAME: