// Path: library/src/main/java/com/danikula/videocache/SourceInfo.java
// public class SourceInfo {
// 
//     public final String url;
//     public final long length;
//     public final String mime;
// 
//     public SourceInfo(String url, long length, String mime) {
//         this.url = url;
//         this.length = length;
//         this.mime = mime;
//     }
// 
//     @Override
//     public String toString() {
//         return "SourceInfo{" +
//                 "url='" + url + '\'' +
//                 ", length=" + length +
//                 ", mime='" + mime + '\'' +
//                 '}';
//     }
// }
// 
// Path: library/src/main/java/com/danikula/videocache/Preconditions.java
// public static void checkAllNotNull(Object... references) {
//     for (Object reference : references) {
//         if (reference == null) {
//             throw new NullPointerException();
//         }
//     }
// }
// 
// Path: library/src/main/java/com/danikula/videocache/Preconditions.java
// public static <T> T checkNotNull(T reference) {
//     if (reference == null) {
//         throw new NullPointerException();
//     }
//     return reference;
// }


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.danikula.videocache.SourceInfo;
import static com.danikula.videocache.Preconditions.checkAllNotNull;
import static com.danikula.videocache.Preconditions.checkNotNull;
        checkNotNull(context);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        checkNotNull(db);
        db.execSQL(CREATE_SQL);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        throw new IllegalStateException("Should not be called. There is no any migration");
    }

    @Override
    public SourceInfo get(String url) {
        checkNotNull(url);
        Cursor cursor = null;
        try {
            cursor = getReadableDatabase().query(TABLE, ALL_COLUMNS, COLUMN_URL + "=?", new String[]{url}, null, null, null);
            return cursor == null || !cursor.moveToFirst() ? null : convert(cursor);
        } finally {
            if (cursor != null) {
                cursor.close();
            }
        }
    }

    @Override
    public void put(String url, SourceInfo sourceInfo) {
// Path: library/src/main/java/com/danikula/videocache/SourceInfo.java
// public class SourceInfo {
// 
//     public final String url;
//     public final long length;
//     public final String mime;
// 
//     public SourceInfo(String url, long length, String mime) {
//         this.url = url;
//         this.length = length;
//         this.mime = mime;
//     }
// 
//     @Override
//     public String toString() {
//         return "SourceInfo{" +
//                 "url='" + url + '\'' +
//                 ", length=" + length +
//                 ", mime='" + mime + '\'' +
//                 '}';
//     }
// }
// 
// Path: library/src/main/java/com/danikula/videocache/Preconditions.java
// public static void checkAllNotNull(Object... references) {
//     for (Object reference : references) {
//         if (reference == null) {
//             throw new NullPointerException();
//         }
//     }
// }
// 
// Path: library/src/main/java/com/danikula/videocache/Preconditions.java
// public static <T> T checkNotNull(T reference) {
//     if (reference == null) {
//         throw new NullPointerException();
//     }
//     return reference;
// }


// Path: library/src/main/java/com/danikula/videocache/sourcestorage/DatabaseSourceInfoStorage.java
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.danikula.videocache.SourceInfo;
import static com.danikula.videocache.Preconditions.checkAllNotNull;
import static com.danikula.videocache.Preconditions.checkNotNull;

        checkNotNull(context);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        checkNotNull(db);
        db.execSQL(CREATE_SQL);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        throw new IllegalStateException("Should not be called. There is no any migration");
    }

    @Override
    public SourceInfo get(String url) {
        checkNotNull(url);
        Cursor cursor = null;
        try {
            cursor = getReadableDatabase().query(TABLE, ALL_COLUMNS, COLUMN_URL + "=?", new String[]{url}, null, null, null);
            return cursor == null || !cursor.moveToFirst() ? null : convert(cursor);
        } finally {
            if (cursor != null) {
                cursor.close();
            }
        }
    }

    @Override
    public void put(String url, SourceInfo sourceInfo) {
        checkAllNotNull(url, sourceInfo);