
Message are represented using the standard corresponding signed types in theĭSL, for compatibility with Java and older versions of Kotlin. As the message type is still defined in Java, unsigned types in the GetFoo() will return the default value for the field’s type.įor other simple field types, the corresponding Java type is chosen according toįor message and enum types, the value type is replaced with the message or enumĬlass.

Note that properties always use camel-case naming, even if the field name in the Properties on the message object from the getters generated by Java.) In addition to the methods described in the previous section, the protocolīuffer compiler generates mutable properties in the DSL for each field defined Object FooKt inline fun foo ( block : FooKt. java file containing a Java class which represents the. proto file input, the compiler creates a wrapper Where you want the compiler to write your Java output, and the same for the The parameter to the -java_out= option is the directory

As a result, it must be invoked with two command-line flags, -java_out=Īnd -kotlin_out=. The protocol buffer compiler produces Kotlin code that builds on top of JavaĬode. Not the base message classes/interfaces, which are the same in both versions.īefore reading this document. That these differences are in the generated code as described in this document,

Generates for any given protocol definition, in addition to the code generatedĭifferences between proto2 and proto3 generated code are highlighted-note This page describes exactly what Kotlin code the protocol buffer compiler This topic describes exactly what Kotlin code the protocol buffer compiler generates for any given protocol definition,
