protobuf/java/kotlin
Éamonn McManus 39a1c6a46e In the Kotlin DSL, reference builder methods with property syntax.
Instead of _builder.getFoo() and _builder.setFoo(value), the generated code now uses _builder.foo and _builder.foo = value. When compiling against the Java Proto API, this makes no difference, since the Kotlin compiler treats Java methods getFoo/setFoo as defining a Kotlin property foo. But if a compatible proto API is implemented in Kotlin then there is no such equivalence. Such an implementation would have to define either both forms or just the one that the DSL uses. For a Kotlin API it is more natural to use properties.

Similarly, the generated Java methods getFoosList(), getFoosCount(), getFoosMap(), and getEnumValue() are accessed via property names (foosList, foosCount, foosMap, enumValue).

(This is the second application of this change. The first had to be rolled back because it didn't handle conflict-resolution names correctly.)

PiperOrigin-RevId: 629807104
2024-05-01 12:49:52 -07:00
..
src In the Kotlin DSL, reference builder methods with property syntax. 2024-05-01 12:49:52 -07:00
BUILD.bazel Refactor editions infrastructure to a top-level directory. 2024-04-16 11:13:19 -07:00
generate-sources-build.xml Add java_features.proto to kotlin_mvn release 2024-03-22 15:11:06 -07:00
generate-test-sources-build.xml Sync from Piper @371422642 2021-04-30 16:12:50 -07:00
pom.xml Updating version.json and repo version numbers to: 28-dev (#16555) 2024-04-18 10:47:14 -07:00
pom_template.xml Add version to intra proto dependencies and add kotlin stdlib dependency 2023-03-10 00:13:38 +00:00