Details
-
Feature Request
-
Resolution: Done
-
Optional
-
None
-
None
-
None
Description
Introduce a {{@Pos(
{n, n, n})}} annotation that allows repeating and positional adjustment of a parameter This would allow for things like this:
@LogMessage(level = DEBUG) @Message(value = "Got a %d (%x)") void gotNumber(@Pos({1, 2}) int value);
Unqualified parameters start counting from the position of the previous parameter. If two parameters end up in the same position it's an error; if a position has no parameter that's an error as well.
Positional parameters should allow for multiple transformations too:
@LogMessage(level = DEBUG) @Message(value = "Got a %s with a type of %s which has a hash code of %x") void gotThing(@Pos(value = {1, 2, 3}, transform = {{}, {GET_CLASS}, {GET_CLASS, HASH_CODE}) Object thing);