core / com.vmadalin.core.database.characterfavorite / CharacterFavoriteRepository

CharacterFavoriteRepository

class CharacterFavoriteRepository

Repository module for handling character favorite data operations CharacterFavoriteDao.

Constructors

<init>

Repository module for handling character favorite data operations CharacterFavoriteDao.

CharacterFavoriteRepository(characterFavoriteDao: CharacterFavoriteDao)

Functions

deleteAllCharactersFavorite

Delete all database favorite characters.

suspend fun deleteAllCharactersFavorite(): Unit

deleteCharacterFavorite

Delete database favorite character.

suspend fun deleteCharacterFavorite(character: CharacterFavorite): Unit

deleteCharacterFavoriteById

Delete database favorite character by identifier.

suspend fun deleteCharacterFavoriteById(characterFavoriteId: Long): Unit

getAllCharactersFavorite

Obtain all database added favorite characters ordering by name field.

suspend fun getAllCharactersFavorite(): List<CharacterFavorite>

getAllCharactersFavoriteLiveData

Obtain all database added favorite characters ordering by name field.

fun getAllCharactersFavoriteLiveData(): LiveData<List<CharacterFavorite>>

getCharacterFavorite

Obtain database favorite character by identifier.

suspend fun getCharacterFavorite(characterFavoriteId: Long): CharacterFavorite?

insertCharacterFavorite

Add to database a favorite character.

suspend fun insertCharacterFavorite(id: Long, name: String, imageUrl: String): Unit

insertCharactersFavorites

Add to database a list of favorite characters.

suspend fun insertCharactersFavorites(characters: List<CharacterFavorite>): Unit