mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-05-14 11:36:21 -04:00
Migrate Enums and Interfaces to kotlin (#2710)
Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
This commit is contained in:
committed by
GitHub
parent
3e77ab6845
commit
81db39d4e1
@@ -1,5 +0,0 @@
|
||||
package protect.card_locker;
|
||||
|
||||
public interface BarcodeImageWriterResultCallback {
|
||||
void onBarcodeImageWriterResult(boolean success);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package protect.card_locker
|
||||
|
||||
interface BarcodeImageWriterResultCallback {
|
||||
fun onBarcodeImageWriterResult(success: Boolean)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package protect.card_locker.async;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public interface CompatCallable<T> extends Callable<T> {
|
||||
void onPostExecute(Object result);
|
||||
|
||||
void onPreExecute();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package protect.card_locker.async
|
||||
|
||||
import java.util.concurrent.Callable
|
||||
|
||||
interface CompatCallable<T> : Callable<T?> {
|
||||
fun onPostExecute(result: Any?)
|
||||
|
||||
fun onPreExecute()
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package protect.card_locker.importexport;
|
||||
|
||||
public enum DataFormat {
|
||||
Catima,
|
||||
Fidme,
|
||||
VoucherVault;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package protect.card_locker.importexport
|
||||
|
||||
enum class DataFormat {
|
||||
Catima,
|
||||
Fidme,
|
||||
VoucherVault
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package protect.card_locker.importexport;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* Interface for a class which can export the contents of the database
|
||||
* in a given format.
|
||||
*/
|
||||
public interface Exporter {
|
||||
/**
|
||||
* Export the database to the output stream in a given format.
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
void exportData(Context context, SQLiteDatabase database, OutputStream output, char[] password) throws IOException, InterruptedException;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package protect.card_locker.importexport
|
||||
|
||||
import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import java.io.IOException
|
||||
import java.io.OutputStream
|
||||
|
||||
/**
|
||||
* Interface for a class which can export the contents of the database
|
||||
* in a given format.
|
||||
*/
|
||||
interface Exporter {
|
||||
/**
|
||||
* Export the database to the output stream in a given format.
|
||||
*
|
||||
* @throws IOException, InterruptedException
|
||||
*/
|
||||
@Throws(IOException::class, InterruptedException::class)
|
||||
fun exportData(
|
||||
context: Context,
|
||||
database: SQLiteDatabase,
|
||||
output: OutputStream,
|
||||
password: CharArray
|
||||
)
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package protect.card_locker.importexport;
|
||||
|
||||
public enum ImportExportResultType {
|
||||
Success,
|
||||
GenericFailure,
|
||||
BadPassword;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package protect.card_locker.importexport
|
||||
|
||||
enum class ImportExportResultType {
|
||||
Success,
|
||||
GenericFailure,
|
||||
BadPassword
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package protect.card_locker.importexport;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import protect.card_locker.FormatException;
|
||||
|
||||
/**
|
||||
* Interface for a class which can import the contents of a stream
|
||||
* into the database.
|
||||
*/
|
||||
public interface Importer {
|
||||
/**
|
||||
* Import data from the input stream in a given format into
|
||||
* the database.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws FormatException
|
||||
*/
|
||||
void importData(Context context, SQLiteDatabase database, File inputFile, char[] password) throws IOException, FormatException, InterruptedException, JSONException, ParseException;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package protect.card_locker.importexport
|
||||
|
||||
import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import org.json.JSONException
|
||||
import protect.card_locker.FormatException
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.text.ParseException
|
||||
|
||||
/**
|
||||
* Interface for a class which can import the contents of a stream
|
||||
* into the database.
|
||||
*/
|
||||
interface Importer {
|
||||
/**
|
||||
* Import data from the input stream in a given format into
|
||||
* the database.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws FormatException
|
||||
* @throws InterruptedException
|
||||
* @throws JSONException
|
||||
* @throws ParseException
|
||||
*/
|
||||
@Throws(
|
||||
IOException::class,
|
||||
FormatException::class,
|
||||
InterruptedException::class,
|
||||
JSONException::class,
|
||||
ParseException::class
|
||||
)
|
||||
fun importData(
|
||||
context: Context,
|
||||
database: SQLiteDatabase,
|
||||
inputFile: File,
|
||||
password: CharArray
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user