1

I'm searching the best way to make documentations with overloaded methods.

I have two methods:

/**
* does something
* @param A
* @return result
*/
public String methodA(Type1 A);

/**
 * does something
 * @param A
* @return result
*/
public String methodA(Type2 A);

Since both methods render the same thing, is it possible to centralize the doc on a method which would take Object arguments? Or is there a better way to do so?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
merours
  • 4,076
  • 7
  • 37
  • 69

1 Answers1

1

I think that your original intention to write a kind of "generic" documentation does not work out of the box. You need to take care of the parameters and the return value at least.

Or is there a better way to do so ?

To avoid redundancy of the actual documentation, you can use the @link tag.

This is especially useful if the method requires a lot of documentation, like for example the Properties.load() methods.

Andreas Fester
  • 36,091
  • 7
  • 95
  • 123