Class DeckRepository
- java.lang.Object
-
- edu.cnm.deepdive.cardcombat.service.DeckRepository
-
-
Constructor Summary
Constructors Constructor Description DeckRepository(Context context)
The constructor initializes the context, the database, and the dao.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Completable
delete(Deck deck)
Deletes a deck in the database.LiveData<Deck>
get(long id)
Returns LiveData of a deck, given its id.Completable
save(Deck deck)
Creates or updates a deck in the database.
-
-
-
Constructor Detail
-
DeckRepository
public DeckRepository(Context context)
The constructor initializes the context, the database, and the dao.- Parameters:
context
- The application context.
-
-
Method Detail
-
save
public Completable save(Deck deck)
Creates or updates a deck in the database.- Parameters:
deck
- TheDeck
.- Returns:
- A
Completable
indicating the success or failure of the creation/update.
-
delete
public Completable delete(Deck deck)
Deletes a deck in the database.- Parameters:
deck
- TheDeck
.- Returns:
- A
Completable
indicating the success or failure of the deletion.
-
-