There's no utility method for getting a Record's canonical constructor reflectively. However, it's fairly simple to do given the array of record components. This message suggests this is sufficient if there is an example in the javadoc:
https://mail.openjdk.java.net/pipermail/amber-spec-experts/2019-September/001607.html
However, there is no such example. One needs to be added.
Adding the example to Class::getRecordComponents seems reasonable. It might be useful to add a link to it from the java.lang.Record class specification, where it defines the record component concept.
https://mail.openjdk.java.net/pipermail/amber-spec-experts/2019-September/001607.html
However, there is no such example. One needs to be added.
Adding the example to Class::getRecordComponents seems reasonable. It might be useful to add a link to it from the java.lang.Record class specification, where it defines the record component concept.