// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/FetchException.java
// public class FetchException extends Exception {
// 
//     public FetchException() {
//     }
// 
//     public FetchException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public FetchException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public FetchException(Throwable throwable) {
//         super(throwable);
//     }
// }


import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import com.kifile.android.cornerstone.core.FetchException;
    public CursorFetcher setProjection(String[] projections) {
        mProjections = projections;
        return this;
    }

    public CursorFetcher setSelection(String selection, String[] selectionArgs) {
        mSelection = selection;
        mSelectionArgs = selectionArgs;
        return this;
    }

    public CursorFetcher setOrderBy(String orderBy) {
        mOrderBy = orderBy;
        return this;
    }

    /**
     * If you want to change the params of fetcher, call it to reset the old params.
     *
     * @return
     */
    public CursorFetcher clear() {
        mProjections = null;
        mSelection = null;
        mSelectionArgs = null;
        mOrderBy = null;
        return this;
    }

    @Override
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/FetchException.java
// public class FetchException extends Exception {
// 
//     public FetchException() {
//     }
// 
//     public FetchException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public FetchException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public FetchException(Throwable throwable) {
//         super(throwable);
//     }
// }


// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/fetchers/CursorFetcher.java
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import com.kifile.android.cornerstone.core.FetchException;

    public CursorFetcher setProjection(String[] projections) {
        mProjections = projections;
        return this;
    }

    public CursorFetcher setSelection(String selection, String[] selectionArgs) {
        mSelection = selection;
        mSelectionArgs = selectionArgs;
        return this;
    }

    public CursorFetcher setOrderBy(String orderBy) {
        mOrderBy = orderBy;
        return this;
    }

    /**
     * If you want to change the params of fetcher, call it to reset the old params.
     *
     * @return
     */
    public CursorFetcher clear() {
        mProjections = null;
        mSelection = null;
        mSelectionArgs = null;
        mOrderBy = null;
        return this;
    }

    @Override
    public Cursor fetch() throws FetchException, ConvertException {