Joined September 2013
·
Posted to
Connection Pooling with Spring RestTemplate
over 1 year
ago
Thanks for this tip, just what I was looking for. Sadly this doesn't seem to be part of the official documentation.
Achievements
28 Karma
0 Total ProTip Views
Komodo Dragon
Have at least one original repo where Java is the dominant language
Velociraptor
Have at least one original repo where Perl is the dominant language
Raven
Have at least one original repo where some form of shell script is the dominant language
Java 8 also has a static join() method which is much more powerful than your append method (you can e.g. define a delimiter for joining).
But if you're stuck with Java < 8 your implementation is quite nice.
To avoid code duplication, I would suggest that insert calls append with the array reversed, something like: