RFR - JDK-8203703 String::transform (CSR Review)
james.laskey at oracle.com
Wed Sep 19 13:51:19 UTC 2018
I’m not married to the name (I suggested apply). “with” also works. The originating goal was to allow custom alignment methods for those developers not satisfied with String::align(). String would logically be the result. “transform" became generic when the case was made that other types might also be relevant.
HTMLDocument html = `
Not a strong argument. Along with Remi’s request for primitive variants, I might be lead back to just supporting String.
> On Sep 19, 2018, at 10:25 AM, Stephen Colebourne <scolebourne at joda.org> wrote:
> On Tue, 18 Sep 2018 at 18:57, Jim Laskey <james.laskey at oracle.com> wrote:
>> Please review the API for String::transform. The goal is to provide a String instance method to allow function application of custom transformations applied to an instance of String.
>> csr: https://bugs.openjdk.java.net/browse/JDK-8203703
>> jbs: https://bugs.openjdk.java.net/browse/JDK-8203442
> The similar method in java.time.* is named `with`
> String capped =
> However, I note that this method is designed to return any type, not
> just String (making it a different kind of method). But *why* return
> any type? The motivation for doing so is not clear from the CSR.
More information about the core-libs-dev