|
|
@ -1526,7 +1526,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@Suppress(\"UNCHECKED_CAST\")\n" |
|
|
|
"@Suppress(\"UNCHECKED_CAST\")\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"public operator fun <T> get(extension: " |
|
|
|
"public operator fun <T : Any> get(extension: " |
|
|
|
"com.google.protobuf.ExtensionLite<$message$, T>): T {\n" |
|
|
|
"com.google.protobuf.ExtensionLite<$message$, T>): T {\n" |
|
|
|
" return if (extension.isRepeated) {\n" |
|
|
|
" return if (extension.isRepeated) {\n" |
|
|
|
" get(extension as com.google.protobuf.ExtensionLite<$message$, " |
|
|
|
" get(extension as com.google.protobuf.ExtensionLite<$message$, " |
|
|
@ -1542,7 +1542,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
"@kotlin.OptIn" |
|
|
|
"@kotlin.OptIn" |
|
|
|
"(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" |
|
|
|
"(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n" |
|
|
|
"@kotlin.jvm.JvmName(\"-getRepeatedExtension\")\n" |
|
|
|
"@kotlin.jvm.JvmName(\"-getRepeatedExtension\")\n" |
|
|
|
"public operator fun <E> get(\n" |
|
|
|
"public operator fun <E : Any> get(\n" |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, List<E>>\n" |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, List<E>>\n" |
|
|
|
"): com.google.protobuf.kotlin.ExtensionList<E, $message$> {\n" |
|
|
|
"): com.google.protobuf.kotlin.ExtensionList<E, $message$> {\n" |
|
|
|
" return com.google.protobuf.kotlin.ExtensionList(extension, " |
|
|
|
" return com.google.protobuf.kotlin.ExtensionList(extension, " |
|
|
@ -1571,7 +1571,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.PublishedApi\n" |
|
|
|
"@kotlin.PublishedApi\n" |
|
|
|
"internal fun <T> setExtension(extension: " |
|
|
|
"internal fun <T : Any> setExtension(extension: " |
|
|
|
"com.google.protobuf.ExtensionLite<$message$, T>, " |
|
|
|
"com.google.protobuf.ExtensionLite<$message$, T>, " |
|
|
|
"value: T) {\n" |
|
|
|
"value: T) {\n" |
|
|
|
" _builder.setExtension(extension, value)\n" |
|
|
|
" _builder.setExtension(extension, value)\n" |
|
|
@ -1585,7 +1585,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" |
|
|
|
" value: T\n" |
|
|
|
" value: T\n" |
|
|
|
") {\n" |
|
|
|
") {\n" |
|
|
|
" setExtension(extension, value)\n" |
|
|
|
" setExtension(extension, value!!)\n" |
|
|
|
"}\n\n", |
|
|
|
"}\n\n", |
|
|
|
"message", message_name); |
|
|
|
"message", message_name); |
|
|
|
|
|
|
|
|
|
|
@ -1597,7 +1597,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
"com.google.protobuf.ByteString>,\n" |
|
|
|
"com.google.protobuf.ByteString>,\n" |
|
|
|
" value: com.google.protobuf.ByteString\n" |
|
|
|
" value: com.google.protobuf.ByteString\n" |
|
|
|
") {\n" |
|
|
|
") {\n" |
|
|
|
" setExtension(extension, value)\n" |
|
|
|
" setExtension(extension, value!!)\n" |
|
|
|
"}\n\n", |
|
|
|
"}\n\n", |
|
|
|
"message", message_name); |
|
|
|
"message", message_name); |
|
|
|
|
|
|
|
|
|
|
@ -1608,13 +1608,13 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" |
|
|
|
" extension: com.google.protobuf.ExtensionLite<$message$, T>,\n" |
|
|
|
" value: T\n" |
|
|
|
" value: T\n" |
|
|
|
") {\n" |
|
|
|
") {\n" |
|
|
|
" setExtension(extension, value)\n" |
|
|
|
" setExtension(extension, value!!)\n" |
|
|
|
"}\n\n", |
|
|
|
"}\n\n", |
|
|
|
"message", message_name); |
|
|
|
"message", message_name); |
|
|
|
|
|
|
|
|
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"public fun <E> com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"public fun <E : Any> com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"$message$>.add(value: E) {\n" |
|
|
|
"$message$>.add(value: E) {\n" |
|
|
|
" _builder.addExtension(this.extension, value)\n" |
|
|
|
" _builder.addExtension(this.extension, value)\n" |
|
|
|
"}\n\n", |
|
|
|
"}\n\n", |
|
|
@ -1623,7 +1623,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@Suppress(\"NOTHING_TO_INLINE\")\n" |
|
|
|
"@Suppress(\"NOTHING_TO_INLINE\")\n" |
|
|
|
"public inline operator fun <E> " |
|
|
|
"public inline operator fun <E : Any> " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"$message$>.plusAssign" |
|
|
|
"$message$>.plusAssign" |
|
|
|
"(value: E) {\n" |
|
|
|
"(value: E) {\n" |
|
|
@ -1633,7 +1633,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
|
|
|
|
|
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"public fun <E> com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"public fun <E : Any> com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"$message$>.addAll(values: Iterable<E>) {\n" |
|
|
|
"$message$>.addAll(values: Iterable<E>) {\n" |
|
|
|
" for (value in values) {\n" |
|
|
|
" for (value in values) {\n" |
|
|
|
" add(value)\n" |
|
|
|
" add(value)\n" |
|
|
@ -1644,7 +1644,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@Suppress(\"NOTHING_TO_INLINE\")\n" |
|
|
|
"@Suppress(\"NOTHING_TO_INLINE\")\n" |
|
|
|
"public inline operator fun <E> " |
|
|
|
"public inline operator fun <E : Any> " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"$message$>.plusAssign(values: " |
|
|
|
"$message$>.plusAssign(values: " |
|
|
|
"Iterable<E>) {\n" |
|
|
|
"Iterable<E>) {\n" |
|
|
@ -1654,7 +1654,7 @@ void ImmutableMessageGenerator::GenerateKotlinExtensions( |
|
|
|
|
|
|
|
|
|
|
|
printer->Print( |
|
|
|
printer->Print( |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"@kotlin.jvm.JvmSynthetic\n" |
|
|
|
"public operator fun <E> " |
|
|
|
"public operator fun <E : Any> " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"com.google.protobuf.kotlin.ExtensionList<E, " |
|
|
|
"$message$>.set(index: Int, value: " |
|
|
|
"$message$>.set(index: Int, value: " |
|
|
|
"E) {\n" |
|
|
|
"E) {\n" |
|
|
|