i’m just starting to work with kotlin. my first impressions are really good.
I’m trying to build some kind of store. Part of the store is an objecttype, which is part of the key. Technically is the store hold by an mutableMap.
The objecttype should by provided by an function parameter. But this is my problem. I’m looking for a possibility to only accept objects which are derived from an specific abstract class. Additionally this abstract class needs an generic parameter.
I try something like
fun add(aggrgegateType: Any<Aggregate<Any>>.....)
or with coherence
fun add(aggregateType: Aggregate<Any>......)
Do you have some input for my problems?