Files
postgres-json/src/main/kotlin/fr/postgresjson/entity/EntityCollection.kt
2019-06-03 11:52:30 +02:00

14 lines
268 B
Kotlin

package fr.postgresjson.entity
class EntityCollection<T, E : EntityI<T>> {
var collection: MutableMap<T, E> = mutableMapOf()
fun get(id: T): E? {
return collection[id]
}
fun set(entity: E) {
collection.set(entity.id, entity)
}
}