Suppose I have a method with multiple signatures (just a silly example). The method with all parameters is the actuall workhorse and all other methods are convenience shortcuts.
I have documented the workhorse method using JavaDoc. Since all other methods work the same I do not want to duplicate the documentation.
Is there a way in JavaDoc to link to the full documentation - or some other way to not have to re-write the documentation over and over again?
/**
* Function to format a string
*
* @param s string to be formatted
* @param bold string should be bold?
* @param cursive string should be cursive?
*
* @return a formatted string
*/
public static String formatMe(String s, Boolean bold, Boolean cursive){
String res = s;
// handle bold option
if (bold) {
res = "BOLD" + res + "BOLD";
}
// handle cursive option
if (cursive) {
res = "KURSIVE" + res + "KURSIVE";
}
// return
return res;
}
public static String formatMe(){
return formatMe("", false, false);
}
public static String formatMe(String s){
return formatMe(s, false, false);
}```