mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-04 23:53:51 -04:00
Initial commit of application
This commit is contained in:
29
app/src/main/java/protect/card_locker/LoyaltyCard.java
Normal file
29
app/src/main/java/protect/card_locker/LoyaltyCard.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package protect.card_locker;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
public class LoyaltyCard
|
||||
{
|
||||
public final int id;
|
||||
public final String store;
|
||||
public final String cardId;
|
||||
public final String barcodeType;
|
||||
|
||||
public LoyaltyCard(final int id, final String store, final String cardId, final String barcodeType)
|
||||
{
|
||||
this.id = id;
|
||||
this.store = store;
|
||||
this.cardId = cardId;
|
||||
this.barcodeType = barcodeType;
|
||||
}
|
||||
|
||||
public static LoyaltyCard toLoyaltyCard(Cursor cursor)
|
||||
{
|
||||
int id = cursor.getInt(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.ID));
|
||||
String store = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.STORE));
|
||||
String cardId = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.CARD_ID));
|
||||
String barcodeType = cursor.getString(cursor.getColumnIndexOrThrow(DBHelper.LoyaltyCardDbIds.BARCODE_TYPE));
|
||||
|
||||
return new LoyaltyCard(id, store, cardId, barcodeType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user