app / de.uniks.codliners.stock_simulator.repository / StockbrotRepository

StockbrotRepository

class StockbrotRepository

Repository for accessing, inserting and filtering StockbrotQuotes.

Constructors

<init>

Constructor that allows repository creation from a Context.

StockbrotRepository(context: Context)

Repository for accessing, inserting and filtering StockbrotQuotes.

StockbrotRepository(database: StockAppDatabase)

Properties

quotes

List of all StockbrotQuotes.

val quotes: LiveData<List<StockbrotQuote>>

Functions

addStockbrotQuote

Adds a StockbrotQuote into the database.

suspend fun addStockbrotQuote(stockbrotQuote: StockbrotQuote): Unit

removeStockbrotQuote

Removes a specific StockbrotQuote from the database.

suspend fun removeStockbrotQuote(stockbrotQuote: StockbrotQuote): Unit

resetStockbrot

Removes all StockbrotQuotes from the database.

suspend fun resetStockbrot(): Unit

stockbrotQuoteById

Returns a StockbrotQuote with the matching id.

fun stockbrotQuoteById(id: String): StockbrotQuote?

stockbrotQuoteWithId

Returns a StockbrotQuote with the matching id, wrapped in LiveData.

fun stockbrotQuoteWithId(id: String): LiveData<StockbrotQuote>