DefaultItemService

Default ItemService implementation.

Author

Jan Müller
class DefaultItemService(itemRepository: ItemRepository) : ItemService

Constructors

<init>
Link copied to clipboard
fun <init>(itemRepository: ItemRepository)

Functions

createItem
Link copied to clipboard
Creates an Item. Must validate that the Item does not exist and the data is valid.
open suspend override fun createItem(item: Item): Result<String>
deleteItemById
Link copied to clipboard
Deletes an Item by id. Must validate that the Item exists.
open suspend override fun deleteItemById(id: String): Result<String>
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getAllItems
Link copied to clipboard
Returns all Items.
open suspend override fun getAllItems(): Result<List<Item>>
getItemById
Link copied to clipboard
Returns the Item with the given id. Must validate that the Item exists.
open suspend override fun getItemById(id: String): Result<Item>
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String
updateItem
Link copied to clipboard
Updates an Item. Must validate that the Item exists and the data is valid.
open suspend override fun updateItem(item: Item): Result<String>