On 09/09/2026 18:00, Tagir Valeev wrote:
Thank you for your suggestions. I see that there's a general
preference towards adding a static method to the Collectors class, so
let's move in this direction. So far, I've seen several proposals for
the method name:
- formatting
- listFormatting
- joiningLocalized
Assuming the most common format types are STANDARD and OR then another
suggestion for your list is "joiningConjunctively" and
"joiningDisjunctively".
This line of naming would help remove the need to specify a ListFormat
and instead focus on having Locale be the parameter to give you examples
like this;
Collectors.joining(", ") => "foo, bar, baz"
Collectors.joiningConjunctively(Locale.US) => "foo, bar, and baz"
Collectors.joiningConjunctively(Locale.UK) => "foo, bar and baz"
Collectors.joiningDisjunctively(Locale.US) => "foo, bar, or baz"
Collectors.joiningDisjunctively(Locale.UK) => "foo, bar or baz"
which I think isn't too bad.
-Alan.