kotlin access modifiers extending generic abstract class with internal class as generic parameter

88 Views Asked by At

I am trying to implement Business objects, so i have PEmail (persistance object) class and BEmail (business interface). And others as follows

class EmailImpl internal constructor(persistent: PEmail): BEmail, BBase<PEmail>(persistent)

abstract class BBase<P> internal constructor(internal val persistent:P)

Can't figure out how to hide the persistance objects like PEmail internally. IDE giving me this message 'public' subclass exposes its 'internal' supertype argument Email every time i set PEmail internal. If kotlin does not support this kind of operation what can I do to make it work? With JAVA it works well.

I tried to set PEmail internal but the only thing that seems to work is setting all properties internal in PEmail class. But this still not solves the problem of hiding the ugly stuff, because class is still visible.

0

There are 0 best solutions below