IntentionallyNonStaticCompanionApi

annotation class IntentionallyNonStaticCompanionApi(val description: String = "", val reason: ExemptionReason = ExemptionReason.OTHER)(source)

Exempts the annotated companion object member from Companion function without JvmStatic and Companion property without static access. On a companion object or a class, it covers every member.

Apply it when Java callers must use the companion instance. Otherwise, add static access with @JvmStatic, @JvmField, or const val, or hide the member from Java with @JvmSynthetic.

Parameters

description

Properties

Link copied to clipboard
Link copied to clipboard