Resource

interface Resource<T, I>

interface that has to be implemented in order to use repositories with a given type T. It also defines how to serialize and deserialize the given type T to and from String. The functions serializeList and deserializeList must be implemented when using it within a QueryRepository.

Functions

Link copied to clipboard
abstract fun deserialize(source: String): T

deserialize a given String to T

Link copied to clipboard
open fun deserializeList(source: String): List<T>

deserialize a given String to a List of T

Link copied to clipboard
abstract fun serialize(item: T): String

serialize an item to String

Link copied to clipboard
open fun serializeId(id: I): String

converts the entity id to a String, default calling toString on it.

Link copied to clipboard
open fun serializeList(items: List<T>): String

serialize a List of items to String

Properties

Link copied to clipboard
abstract val idProvider: IdProvider<T, I>

function to provide an id for a given entity