nkiesel
01/23/2020, 7:17 PMManager delegates all calls to an implementation of an interface Service (there are multiple possible implementations of Service, Manager picks one at startup). Right now, the code does
object Manager { val delegate = pickImpl(); @JvmStatic fun foo() = delegate.foo(); @JvmStatic fun bar(a: Int) = delegate.bar(a); ... }
and the Java code calls Manager.foo(). This could be simplified to object Manager : Service by pickImpl() but then the Java code has to be changed to call Manager.INSTANCE.foo(). Is there a way to use delegation but retain the JVMStatic for the Java code?