Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any equivalent for javadoc's @hide?

Tags:

kotlin

kdoc

I'm trying to hide a method that should be visible only for test usage.

Is there any equivalent for javadoc's @hide

I'm not an expert using KDoc neither JavaDoc, If I'm missing any concept please point me to it.

/** @hide */
fun methodToHide() : String = "foo"
like image 671
crgarridos Avatar asked Sep 11 '25 13:09

crgarridos


1 Answers

If you really want to show that method/function is not part of public API and is exposed only to be testable, it's considered to be a good practice to use annotation @VisibleForTesting. If you don't have guava or similar library in your project you can create such annotation easiily yourself.

like image 167
asm0dey Avatar answered Sep 13 '25 13:09

asm0dey