I used it MessageFormat.format()for a while, but there is one thing that I find annoying.
Each time you declare a parameter in a message, you must know the position of the displayed argument. eg.
MessageFormat.format("{0} is annoying {1}.", "this", "indeed")
Is there the same class as MessageFormat, but allows you to completely omit the position of the argument in the parameter declaration and by default indicate its position in the message, so that the first parameter is mapped to the first argument, the second parameter to the second argument, and so on? eg.
MessageFormat.format("{} is much better{}.", "this", "indeed")
I think later versions of log4j have a similar function, but I just need a formatting class.
Happy New Year!
EDIT . I need this function for approval, so it is really for internal use, but I appreciate your understanding of why MessageFormat works the way it does.
source
share