// Path: sqlitefinal/src/main/java/cn/finalteam/sqlitefinal/sqlite/ColumnDbType.java
// public enum ColumnDbType {
// 
//     INTEGER("INTEGER"), REAL("REAL"), TEXT("TEXT"), BLOB("BLOB");
// 
//     private String value;
// 
//     ColumnDbType(String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public String toString() {
//         return value;
//     }
// }


import android.database.Cursor;
import android.text.TextUtils;
import cn.finalteam.sqlitefinal.sqlite.ColumnDbType;
package cn.finalteam.sqlitefinal.converter;


/**
 * Author: wyouflf
 * Date: 13-11-4
 * Time: 下午10:51
 */
public class ShortColumnConverter implements ColumnConverter<Short> {
    @Override
    public Short getFieldValue(final Cursor cursor, int index) {
        return cursor.isNull(index) ? null : cursor.getShort(index);
    }

    @Override
    public Short getFieldValue(String fieldStringValue) {
        if (TextUtils.isEmpty(fieldStringValue)) return null;
        return Short.valueOf(fieldStringValue);
    }

    @Override
    public Object fieldValue2ColumnValue(Short fieldValue) {
        return fieldValue;
    }

    @Override
    public ColumnDbType getColumnDbType() {
// Path: sqlitefinal/src/main/java/cn/finalteam/sqlitefinal/sqlite/ColumnDbType.java
// public enum ColumnDbType {
// 
//     INTEGER("INTEGER"), REAL("REAL"), TEXT("TEXT"), BLOB("BLOB");
// 
//     private String value;
// 
//     ColumnDbType(String value) {
//         this.value = value;
//     }
// 
//     @Override
//     public String toString() {
//         return value;
//     }
// }


// Path: sqlitefinal/src/main/java/cn/finalteam/sqlitefinal/converter/ShortColumnConverter.java
import android.database.Cursor;
import android.text.TextUtils;
import cn.finalteam.sqlitefinal.sqlite.ColumnDbType;

package cn.finalteam.sqlitefinal.converter;


/**
 * Author: wyouflf
 * Date: 13-11-4
 * Time: 下午10:51
 */
public class ShortColumnConverter implements ColumnConverter<Short> {
    @Override
    public Short getFieldValue(final Cursor cursor, int index) {
        return cursor.isNull(index) ? null : cursor.getShort(index);
    }

    @Override
    public Short getFieldValue(String fieldStringValue) {
        if (TextUtils.isEmpty(fieldStringValue)) return null;
        return Short.valueOf(fieldStringValue);
    }

    @Override
    public Object fieldValue2ColumnValue(Short fieldValue) {
        return fieldValue;
    }

    @Override
    public ColumnDbType getColumnDbType() {
        return ColumnDbType.INTEGER;