Add EntityCollection

This commit is contained in:
2019-06-03 11:49:30 +02:00
parent 366d8edab3
commit 65fb032ad9
6 changed files with 69 additions and 11 deletions

View File

@@ -0,0 +1,13 @@
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)
}
}