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

deserialize
Link copied to clipboard
common
abstract fun deserialize(source: String): T
deserialize a given String to T
deserializeList
Link copied to clipboard
common
open fun deserializeList(source: String): List<T>
deserialize a given String to a List of T
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
serialize
Link copied to clipboard
common
abstract fun serialize(item: T): String
serialize an item to String
serializeId
Link copied to clipboard
common
open fun serializeId(id: I): String
converts the entity id to a String, default calling toString on it.
serializeList
Link copied to clipboard
common
open fun serializeList(items: List<T>): String
serialize a List of items to String
toString
Link copied to clipboard
common
open fun toString(): String

Properties

idProvider
Link copied to clipboard
common
abstract val idProvider: IdProvider<T, I>
function to provide an id for a given entity