```interface RemoteFeatureFlagProvider { fun f...
# random
j
Copy code
interface RemoteFeatureFlagProvider {
    fun fetchFullConfig(useNetwork: Boolean)
    fun <T> getFeatureFlag(key: String, type: Class<T>): T

}

inline fun <reified T> RemoteFeatureFlagProvider.get(key: String): T {
    return getFeatureFlag(key, T::class.java)
}
is there a way to hide
fun <T> getFeatureFlag(key: String, type: Class<T>): T
from being accessed ? I want the users to use only extension function so that they can directly use generics instead of passing
Foo::class.java
in the interface method
I have an internal implementation for this. so I thought of casting inside the extension but I cannot access non-public class's method as well in the extension method
p
You can mark the internal method as @PublishedAPI and expose it through a public inline method
j
The impl class is marked as
internal
so i cannot access that method through a public inline method 😕
s
@Jeevan Deep Singh
@PublishedApi
allows you to call internal classes/members from public inline functions: some site with example
☝️ 1