diff --git a/README.md b/README.md index 15b2ab238..88b3a8410 100644 --- a/README.md +++ b/README.md @@ -8,45 +8,11 @@ Protocol Buffer compiler and runtime for Kotlin. Supports only version 3 of the Protocol Buffers language. -* [Overview](#overview) - + [Features](#features) - + [Not yet implemented](#not-yet-implemented) - + [Compatibility](#compatibility) -* [Usage](#usage) - + [Gradle](#gradle) - + [Generated Code](#generated-code) -* [Runtime Notes](#runtime-notes) - + [Package](#package) - + [Message](#message) - + [Enums](#enums) - - [Representation](#representation) - - [Naming](#naming) - + [Other Notes](#other-notes) -* [Extensions](#extensions) - + [Wrapper Types](#wrapper-types) - + [Non-null fields](#non-null-fields) - + [Interface implementation](#interface-implementation) - - [Messages](#messages) - - [Oneof Fields](#oneof-fields) - + [BytesSlice](#bytesslice) -* [gRPC code generation](#grpc-code-generation) - + [Generated gRPC code](#generated-grpc-code) - - [`grpcDescriptors`](#grpcdescriptors) - - [`grpcKotlinStubs` and gRPC's Kotlin API](#grpckotlinstubs-and-grpcs-kotlin-api) - - [Integrating with gRPC's Java API](#integrating-with-grpcs-java-api) - - [Integrating with gRPC's Kotlin API](#integrating-with-grpcs-kotlin-api) - - [Integrating with gRPC's NodeJS API](#integrating-with-grpcs-nodejs-api) -* [IntelliJ integration](#intellij-integration) -* [Command line code generation](#command-line-code-generation) -* [Contribution](#contribution) -* [Acknowledgements](#acknowledgements) - + [Authors](#authors) - ## Overview ### Features - Idiomatic and concise [Kotlin builder DSL](#generated-code) -- Protokt-specific options: [non-null types](#non-null-fields), +- Protokt-specific options: [non-null types (dangerous)](#non-null-fields), [wrapper types](#wrapper-types), [interface implementation](#interface-implementation), and more @@ -150,19 +116,22 @@ message Sample { will produce: ```kotlin -// Generated by protokt version 1.0.0-alpha.7-SNAPSHOT. Do not modify. -// Source: test_file.proto +// Generated by protokt version 1.0.0-beta.2-SNAPSHOT. Do not modify. +// Source: protokt/v1/testing/test.proto @file:Suppress("DEPRECATION") package protokt.v1.toasttab.protokt.sample -import protokt.v1.AbstractKtDeserializer -import protokt.v1.AbstractKtMessage -import protokt.v1.KtBuilderDsl -import protokt.v1.KtMessageDeserializer -import protokt.v1.KtMessageSerializer +import protokt.v1.AbstractDeserializer +import protokt.v1.AbstractMessage +import protokt.v1.BuilderDsl +import protokt.v1.GeneratedFileDescriptor +import protokt.v1.GeneratedMessage +import protokt.v1.GeneratedProperty +import protokt.v1.Reader import protokt.v1.SizeCodecs.sizeOf import protokt.v1.UnknownFieldSet +import protokt.v1.Writer import protokt.v1.google.protobuf.Descriptor import protokt.v1.google.protobuf.FileDescriptor import kotlin.Any @@ -172,118 +141,113 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmStatic -import com.toasttab.protokt.rt.KtGeneratedFileDescriptor as RtKtGeneratedFileDescriptor -import com.toasttab.protokt.rt.KtGeneratedMessage as RtKtGeneratedMessage -import protokt.v1.KtGeneratedFileDescriptor as V1KtGeneratedFileDescriptor -import protokt.v1.KtGeneratedMessage as V1KtGeneratedMessage -@V1KtGeneratedMessage("toasttab.protokt.sample.Sample") -@RtKtGeneratedMessage("toasttab.protokt.sample.Sample") +@GeneratedMessage("toasttab.protokt.sample.Sample") public class Sample private constructor( - public val sampleField: String, - public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() -) : AbstractKtMessage() { - override val messageSize: Int by lazy { messageSize() } - - private fun messageSize(): Int { - var result = 0 - if (sampleField.isNotEmpty()) { - result += sizeOf(10u) + sizeOf(sampleField) - } - result += unknownFields.size() - return result - } - - override fun serialize(serializer: KtMessageSerializer) { - if (sampleField.isNotEmpty()) { - serializer.writeTag(10u).write(sampleField) + @GeneratedProperty(1) + public val sampleField: String, + public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() +) : AbstractMessage() { + private val `$messageSize`: Int by lazy { + var result = 0 + if (sampleField.isNotEmpty()) { + result += sizeOf(10u) + sizeOf(sampleField) + } + result += unknownFields.size() + result } - serializer.writeUnknown(unknownFields) - } - override fun equals(other: Any?): Boolean = - other is Sample && - other.sampleField == sampleField && - other.unknownFields == unknownFields - - override fun hashCode(): Int { - var result = unknownFields.hashCode() - result = 31 * result + sampleField.hashCode() - return result - } - - override fun toString(): String = - "Sample(" + - "sampleField=$sampleField" + - if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)" - - public fun copy(builder: Builder.() -> Unit): Sample = - Builder().apply { - sampleField = this@Sample.sampleField - unknownFields = this@Sample.unknownFields - builder() - }.build() + override fun messageSize(): Int = `$messageSize` - @KtBuilderDsl - public class Builder { - public var sampleField: String = "" + override fun serialize(writer: Writer) { + if (sampleField.isNotEmpty()) { + writer.writeTag(10u).write(sampleField) + } + writer.writeUnknown(unknownFields) + } - public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty() + override fun equals(other: Any?): Boolean = + other is Sample && + other.sampleField == sampleField && + other.unknownFields == unknownFields - public fun build(): Sample = - Sample( - sampleField, - unknownFields - ) - } + override fun hashCode(): Int { + var result = unknownFields.hashCode() + result = 31 * result + sampleField.hashCode() + return result + } - public companion object Deserializer : AbstractKtDeserializer() { - @JvmStatic - override fun deserialize(deserializer: KtMessageDeserializer): Sample { - var sampleField = "" - var unknownFields: UnknownFieldSet.Builder? = null + override fun toString(): String = + "Sample(" + + "sampleField=$sampleField" + + if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)" + + public fun copy(builder: Builder.() -> Unit): Sample = + Builder().apply { + sampleField = this@Sample.sampleField + unknownFields = this@Sample.unknownFields + builder() + }.build() + + @BuilderDsl + public class Builder { + public var sampleField: String = "" + + public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty() + + public fun build(): Sample = + Sample( + sampleField, + unknownFields + ) + } - while (true) { - when (deserializer.readTag()) { - 0 -> return Sample( - sampleField, - UnknownFieldSet.from(unknownFields) - ) - 10 -> sampleField = deserializer.readString() - else -> - unknownFields = - (unknownFields ?: UnknownFieldSet.Builder()).also { - it.add(deserializer.readUnknown()) - } + public companion object Deserializer : AbstractDeserializer() { + @JvmStatic + override fun deserialize(reader: Reader): Sample { + var sampleField = "" + var unknownFields: UnknownFieldSet.Builder? = null + + while (true) { + when (reader.readTag()) { + 0u -> return Sample( + sampleField, + UnknownFieldSet.from(unknownFields) + ) + 10u -> sampleField = reader.readString() + else -> + unknownFields = + (unknownFields ?: UnknownFieldSet.Builder()).also { + it.add(reader.readUnknown()) + } + } + } } - } - } - @JvmStatic - public operator fun invoke(dsl: Builder.() -> Unit): Sample = Builder().apply(dsl).build() - } + @JvmStatic + public operator fun invoke(dsl: Builder.() -> Unit): Sample = Builder().apply(dsl).build() + } } -@V1KtGeneratedFileDescriptor -@RtKtGeneratedFileDescriptor -public object test_file_file_descriptor { - public val descriptor: FileDescriptor by lazy { - val descriptorData = - arrayOf( - "\ntest_file.prototoasttab.protokt.samp" + - "le\"\nSample\n sample_field (\tbprot" + - "o3" - ) - - FileDescriptor.buildFrom( - descriptorData, - listOf() - ) - } +@GeneratedFileDescriptor +public object test_file_descriptor { + public val descriptor: FileDescriptor by lazy { + val descriptorData = + arrayOf( + "\nprotokt/v1/testing/test.prototoastta" + + "b.protokt.sample\"\nSample\n sample_fie" + + "ld (\tbproto3" + ) + + FileDescriptor.buildFrom( + descriptorData, + listOf() + ) + } } public val Sample.Deserializer.descriptor: Descriptor - get() = test_file_file_descriptor.descriptor.messageTypes[0] + get() = test_file_descriptor.descriptor.messageTypes[0] ``` Construct your protokt object like so: @@ -349,7 +313,7 @@ allowing representation of unknown values. public sealed class PhoneType( override val `value`: Int, override val name: String -) : KtEnum() { +) : Enum() { public object MOBILE : PhoneType(0, "MOBILE") public object HOME : PhoneType(1, "HOME") @@ -360,7 +324,7 @@ public sealed class PhoneType( `value`: Int ) : PhoneType(value, "UNRECOGNIZED") - public companion object Deserializer : KtEnumDeserializer { + public companion object Deserializer : EnumReader { override fun from(`value`: Int): PhoneType = when (value) { 0 -> MOBILE @@ -379,6 +343,74 @@ all values [prefixed with the enum type name](https://developers.google.com/protocol-buffers/docs/style#enums) will have that prefix stripped in their Kotlin representations. +### Reflection + +#### Descriptors + +Protokt generates and embeds descriptors for protobuf files in its output by default. Generation can be disabled +while using the lite runtime: + +```kotlin +protokt { + generate { + descriptors = false + } +} +``` + +#### Interop with `protobuf-java` + +Protokt includes [utilities](protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/Messages.kt) to reflectively +(i.e., no-copy) convert a `protokt.v1.Message` to a `com.google.protobuf.Message`. Conversion requires that you specify +the RuntimeContext of your proto files. If you would like to scan your classpath for all known descriptors at runtime, +you may use Protokt's `GeneratedFileDescriptor` annotation [to do so](testing/interop/src/test/kotlin/protokt/v1/testing/RuntimeContextUtil.kt): + +```kotlin +import com.google.protobuf.DescriptorProtos +import com.google.protobuf.Descriptors +import io.github.classgraph.ClassGraph +import protokt.v1.GeneratedFileDescriptor +import protokt.v1.google.protobuf.FileDescriptor +import protokt.v1.google.protobuf.RuntimeContext +import kotlin.reflect.KClass +import kotlin.reflect.full.declaredMemberProperties + +fun getContextReflectively() = + RuntimeContext(getDescriptors()) + +private fun getDescriptors() = + ClassGraph() + .enableAnnotationInfo() + .scan() + .use { + it.getClassesWithAnnotation(GeneratedFileDescriptor::class.java) + .map { info -> + @Suppress("UNCHECKED_CAST") + info.loadClass().kotlin as KClass + } + } + .asSequence() + .map { klassWithDescriptor -> + klassWithDescriptor + .declaredMemberProperties + .single { it.returnType.classifier == FileDescriptor::class } + .get(klassWithDescriptor.objectInstance!!) as FileDescriptor + } + .flatMap { it.toProtobufJavaDescriptor().messageTypes } + .flatMap(::collectDescriptors) + .asIterable() + +private fun collectDescriptors(descriptor: Descriptors.Descriptor): Iterable = + listOf(descriptor) + descriptor.nestedTypes.flatMap(::collectDescriptors) + +private fun FileDescriptor.toProtobufJavaDescriptor(): Descriptors.FileDescriptor = + Descriptors.FileDescriptor.buildFrom( + DescriptorProtos.FileDescriptorProto.parseFrom(proto.serialize()), + dependencies.map { it.toProtobufJavaDescriptor() }.toTypedArray(), + true + ) +``` + ### Other Notes - `optimize_for` is ignored. @@ -453,30 +485,34 @@ object InstantConverter : AbstractConverter() { ``` ```kotlin -@V1KtGeneratedMessage("protokt.v1.testing.Wrappers") -@RtKtGeneratedMessage("protokt.v1.testing.Wrappers") -public class Wrappers private constructor( - public val instant: Instant, +@GeneratedMessage("protokt.v1.testing.WrapperMessage") +public class WrapperMessage private constructor( + @GeneratedProperty(1) + public val instant: Instant?, public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() -) : AbstractKtMessage() { - override val messageSize: Int by lazy { messageSize() } - - private fun messageSize(): Int { +) : AbstractMessage() { + private val `$messageSize`: Int by lazy { var result = 0 - result += sizeOf(50u) + sizeOf(InstantConverter.unwrap(instant)) + if (instant != null) { + result += sizeOf(10u) + sizeOf(InstantConverter.unwrap(instant)) + } result += unknownFields.size() - return result + result } - override fun serialize(serializer: KtMessageSerializer) { - serializer.writeTag(50u).write(InstantConverter.unwrap(instant)) - serializer.writeUnknown(unknownFields) + override fun messageSize(): Int = `$messageSize` + + override fun serialize(writer: Writer) { + if (instant != null) { + writer.writeTag(10u).write(InstantConverter.unwrap(instant)) + } + writer.writeUnknown(unknownFields) } override fun equals(other: Any?): Boolean = - other is Wrappers && - other.instant == instant && - other.unknownFields == unknownFields + other is WrapperMessage && + other.instant == instant && + other.unknownFields == unknownFields override fun hashCode(): Int { var result = unknownFields.hashCode() @@ -485,60 +521,54 @@ public class Wrappers private constructor( } override fun toString(): String = - "Wrappers(" + - "instant=$instant" + - if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)" + "WrapperMessage(" + + "instant=$instant" + + if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)" - public fun copy(builder: Builder.() -> Unit): Wrappers = + public fun copy(builder: Builder.() -> Unit): WrapperMessage = Builder().apply { - instant = this@Wrappers.instant - unknownFields = this@Wrappers.unknownFields + instant = this@WrapperMessage.instant + unknownFields = this@WrapperMessage.unknownFields builder() }.build() - @KtBuilderDsl + @BuilderDsl public class Builder { public var instant: Instant? = null public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty() - public fun build(): Wrappers = - Wrappers( - requireNotNull(instant) { - StringBuilder("instant") - .append(" specified nonnull with (protokt.property).non_null but was null") - }, + public fun build(): WrapperMessage = + WrapperMessage( + instant, unknownFields ) - } + } - public companion object Deserializer : AbstractKtDeserializer() { + public companion object Deserializer : AbstractDeserializer() { @JvmStatic - override fun deserialize(deserializer: KtMessageDeserializer): Wrappers { + override fun deserialize(reader: Reader): WrapperMessage { var instant: Instant? = null var unknownFields: UnknownFieldSet.Builder? = null while (true) { - when (deserializer.readTag()) { - 0 -> return Wrappers( - requireNotNull(instant) { - StringBuilder("instant") - .append(" specified nonnull with (protokt.property).non_null but was null") - }, + when (reader.readTag()) { + 0u -> return WrapperMessage( + instant, UnknownFieldSet.from(unknownFields) ) - 50 -> instant = InstantConverter.wrap(deserializer.readMessage(Timestamp)) + 10u -> instant = InstantConverter.wrap(reader.readMessage(Timestamp)) else -> unknownFields = (unknownFields ?: UnknownFieldSet.Builder()).also { - it.add(deserializer.readUnknown()) + it.add(reader.readUnknown()) } } } } @JvmStatic - public operator fun invoke(dsl: Builder.() -> Unit): Wrappers = Builder().apply(dsl).build() + public operator fun invoke(dsl: Builder.() -> Unit): WrapperMessage = Builder().apply(dsl).build() } } ``` @@ -689,6 +719,8 @@ message NonNullSampleMessage { Note that deserialization of a message with a non-nullable field will fail if the message being decoded does not contain an instance of the required field. +This functionality will likely be removed. + ### Interface implementation #### Messages @@ -793,7 +825,7 @@ message MyObjectWithConfig { } message ServerSpecified { - option (protokt.v1.class).implements = "Config"; + option (protokt.v1.class).implements = "com.toasttab.example.Config"; int32 version = 1; @@ -802,7 +834,7 @@ message ServerSpecified { } message ClientResolved { - option (protokt.v1.class).implements = "Config by config"; + option (protokt.v1.class).implements = "com.toasttab.example.Config by config"; ServerSpecified config = 1 [ (protokt.v1.property).non_null = true @@ -817,46 +849,56 @@ message ClientResolved { Protokt will generate: ```kotlin -@V1KtGeneratedMessage("toasttab.example.MyObjectWithConfig") -@RtKtGeneratedMessage("toasttab.example.MyObjectWithConfig") +@GeneratedMessage("toasttab.example.MyObjectWithConfig") public class MyObjectWithConfig private constructor( - public val id: UUID, + @GeneratedProperty(1) + public val id: UUID?, public val config: Config, public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() -) : AbstractKtMessage() { - // methods omitted +) : AbstractMessage() { + + // methods and builders omitted - public sealed class Config : ExampleConfig { + public sealed class Config : com.toasttab.example.Config { public data class ServerSpecified( + @GeneratedProperty(2) public val serverSpecified: protokt.v1.toasttab.example.ServerSpecified - ) : Config(), ExampleConfig by serverSpecified + ) : Config(), com.toasttab.example.Config by serverSpecified public data class ClientResolved( + @GeneratedProperty(3) public val clientResolved: protokt.v1.toasttab.example.ClientResolved - ) : Config(), ExampleConfig by clientResolved + ) : Config(), com.toasttab.example.Config by clientResolved } +} - @V1KtGeneratedMessage("toasttab.example.ServerSpecified") - @RtKtGeneratedMessage("toasttab.example.ServerSpecified") - public class ServerSpecified private constructor( - override val version: Int, - public val serverRegistry: String, - public val serverName: String, - public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() - ) : AbstractKtMessage(), ExampleConfig { - // methods omitted - } +@GeneratedMessage("toasttab.example.ServerSpecified") +public class ServerSpecified private constructor( + @GeneratedProperty(1) + override val version: Int, + @GeneratedProperty(2) + public val serverRegistry: String, + @GeneratedProperty(3) + public val serverName: String, + public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() +) : AbstractMessage(), Config { + // methods and builders omitted - @V1KtGeneratedMessage("toasttab.example.ClientResolved") - @RtKtGeneratedMessage("toasttab.example.ClientResolved") - public class ClientResolved private constructor( - public val config: ServerSpecified, - public val lastKnownAddress: InetAddress, - public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() - ) : AbstractKtMessage(), Config by config { - // methods omitted - } +} + +@GeneratedMessage("toasttab.example.ClientResolved") +public class ClientResolved private constructor( + @GeneratedProperty(1) + public val config: ServerSpecified, + @GeneratedProperty(2) + public val lastKnownAddress: InetAddress?, + public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty() +) : AbstractMessage(), Config by config { + + // methods and builders omitted + +} ``` A MyObjectWithConfig.Config instance can be queried for its version without @@ -868,12 +910,14 @@ fun printVersion(config: MyObjectWithConfig.Config) { } ``` -This pattern can be dangerous: since the oneof must be marked non-nullable, you +This pattern is dangerous: since the oneof must be marked non-nullable, you cannot compatibly add new implementing fields to a producer before a consumer is updated with the new generated code. The old consumer will attempt to deserialize the new field as an unknown field and the non-null assertion on the oneof field during the constructor call will fail. +This functionality will likely be removed. + ### BytesSlice When reading messages that contain other serialized messages as `bytes` fields, @@ -899,10 +943,10 @@ when the gRPC generation options are enabled: ```groovy protokt { - generate { - grpcDescriptors = true - grpcKotlinStubs = true - } + generate { + grpcDescriptors = true + grpcKotlinStubs = true + } } ``` diff --git a/buildSrc/src/main/kotlin/LocalProtoktBuild.kt b/buildSrc/src/main/kotlin/LocalProtoktBuild.kt index 13b5cb55f..f297d04d7 100644 --- a/buildSrc/src/main/kotlin/LocalProtoktBuild.kt +++ b/buildSrc/src/main/kotlin/LocalProtoktBuild.kt @@ -16,15 +16,14 @@ import com.google.protobuf.gradle.GenerateProtoTask import org.gradle.api.Project import org.gradle.api.tasks.compile.JavaCompile -import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl import protokt.v1.gradle.CODEGEN_NAME import protokt.v1.gradle.configureProtokt import java.io.File -fun Project.localProtokt() { - configureProtokt(this, null) { +fun Project.localProtokt(disableJava: Boolean = true) { + configureProtokt(this, null, disableJava) { "$rootDir/protokt-codegen/build/install/$CODEGEN_NAME/bin/$CODEGEN_NAME" } diff --git a/extensions/protokt-extensions-lite/build.gradle.kts b/extensions/protokt-extensions-lite/build.gradle.kts index c50a5fae1..cd2c1f05e 100644 --- a/extensions/protokt-extensions-lite/build.gradle.kts +++ b/extensions/protokt-extensions-lite/build.gradle.kts @@ -13,6 +13,7 @@ * limitations under the License. */ +import com.google.protobuf.gradle.proto import protokt.v1.gradle.protokt import protokt.v1.gradle.protoktExtensions @@ -57,6 +58,14 @@ kotlin { } } +sourceSets { + main { + proto { + srcDir("src/extensions-proto") + } + } +} + dependencies { protoktExtensions(project(":extensions:protokt-extensions-simple")) } diff --git a/extensions/protokt-extensions-lite/src/main/proto/protokt/v1/protokt.proto b/extensions/protokt-extensions-lite/src/extensions-proto/protokt/v1/protokt.proto similarity index 100% rename from extensions/protokt-extensions-lite/src/main/proto/protokt/v1/protokt.proto rename to extensions/protokt-extensions-lite/src/extensions-proto/protokt/v1/protokt.proto diff --git a/extensions/protokt-extensions/build.gradle.kts b/extensions/protokt-extensions/build.gradle.kts index a00a3ea3e..597a08397 100644 --- a/extensions/protokt-extensions/build.gradle.kts +++ b/extensions/protokt-extensions/build.gradle.kts @@ -54,6 +54,7 @@ sourceSets { main { proto { srcDir("../protokt-extensions-lite/src/main/proto") + srcDir("../protokt-extensions-lite/src/extensions-proto") } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 54b9cee0a..c85bc433b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -44,6 +44,7 @@ jmh = "1.37" wire = "4.9.7" # test +classgraph = "4.8.153" grpc-js = "1.8.14" jackson = "2.17.0" junit = "5.10.2" @@ -91,6 +92,7 @@ wireRuntime = { module = "com.squareup.wire:wire-runtime", version.ref = "wire" protoGoogleCommonProtos = { module = "com.google.api.grpc:proto-google-common-protos", version.ref = "protoGoogleCommonProtos" } # test +classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classgraph" } grpc-kotlin-stub = { module = "io.grpc:grpc-kotlin-stub", version.ref = "grpc-kotlin" } grpc-testing = { module = "io.grpc:grpc-testing", version.ref = "grpc-java" } jackson = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } diff --git a/protokt-codegen/build.gradle.kts b/protokt-codegen/build.gradle.kts index bc03fa576..6cd5397ad 100644 --- a/protokt-codegen/build.gradle.kts +++ b/protokt-codegen/build.gradle.kts @@ -83,9 +83,10 @@ sourceSets { main { java { srcDir("../shared-src/codegen") + srcDir("../shared-src/reflect") } proto { - srcDir("../extensions/protokt-extensions-lite/src/main/proto") + srcDir("../extensions/protokt-extensions-lite/src/extensions-proto") } } } diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/BuilderGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/BuilderGenerator.kt index 44a2608a0..e430a31b2 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/BuilderGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/BuilderGenerator.kt @@ -27,8 +27,8 @@ import protokt.v1.BuilderDsl import protokt.v1.UnknownFieldSet import protokt.v1.codegen.generate.Deprecation.handleDeprecation import protokt.v1.codegen.util.BUILDER -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Message +import protokt.v1.reflect.FieldType internal fun TypeSpec.Builder.handleBuilder(msg: Message, properties: List) = apply { BuilderGenerator(msg, properties).addBuilder(this) } diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/CodeGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/CodeGenerator.kt index 10a06a04f..94c363818 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/CodeGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/CodeGenerator.kt @@ -27,7 +27,7 @@ import protokt.v1.codegen.util.ProtoFileInfo import protokt.v1.codegen.util.Service import protokt.v1.codegen.util.TopLevelType -object CodeGenerator { +internal object CodeGenerator { data class Context( val enclosing: List, val info: ProtoFileInfo diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerGenerator.kt index 6ac9710d2..20d596f92 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerGenerator.kt @@ -31,23 +31,23 @@ import protokt.v1.UnknownFieldSet import protokt.v1.codegen.generate.CodeGenerator.Context import protokt.v1.codegen.generate.Wrapper.interceptRead import protokt.v1.codegen.generate.Wrapper.wrapField -import protokt.v1.codegen.util.FieldType -import protokt.v1.codegen.util.FieldType.Enum -import protokt.v1.codegen.util.FieldType.SFixed32 -import protokt.v1.codegen.util.FieldType.SFixed64 -import protokt.v1.codegen.util.FieldType.SInt32 -import protokt.v1.codegen.util.FieldType.SInt64 -import protokt.v1.codegen.util.FieldType.UInt32 -import protokt.v1.codegen.util.FieldType.UInt64 import protokt.v1.codegen.util.KotlinPlugin import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField import protokt.v1.codegen.util.Tag +import protokt.v1.reflect.FieldType +import protokt.v1.reflect.FieldType.Enum +import protokt.v1.reflect.FieldType.SFixed32 +import protokt.v1.reflect.FieldType.SFixed64 +import protokt.v1.reflect.FieldType.SInt32 +import protokt.v1.reflect.FieldType.SInt64 +import protokt.v1.reflect.FieldType.UInt32 +import protokt.v1.reflect.FieldType.UInt64 internal val READER = Reader::class.simpleName!!.lowercase() -fun generateDeserializer(msg: Message, ctx: Context, properties: List) = +internal fun generateDeserializer(msg: Message, ctx: Context, properties: List) = DeserializerGenerator(msg, ctx, properties).generate() private class DeserializerGenerator( @@ -214,7 +214,7 @@ private class DeserializerGenerator( CodeBlock.of("%T(%L)", f.qualify(ff), deserialize(ff, ctx)) } -fun deserialize(f: StandardField, ctx: Context, packed: Boolean = false): CodeBlock { +internal fun deserialize(f: StandardField, ctx: Context, packed: Boolean = false): CodeBlock { val read = CodeBlock.of("$READER.%L", interceptRead(f, f.readFn())) val wrappedRead = wrapField(f, ctx, read) ?: read diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerSupport.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerSupport.kt index 09da0cfe5..f2b19ffb6 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerSupport.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/DeserializerSupport.kt @@ -18,16 +18,16 @@ package protokt.v1.codegen.generate import com.squareup.kotlinpoet.CodeBlock import com.squareup.kotlinpoet.buildCodeBlock import com.squareup.kotlinpoet.withIndent -import protokt.v1.codegen.util.FieldType +import protokt.v1.reflect.FieldType -fun deserializeVarInitialState(p: PropertyInfo) = +internal fun deserializeVarInitialState(p: PropertyInfo) = if (p.repeated || p.wrapped || p.nullable || p.fieldType == FieldType.Message) { CodeBlock.of("null") } else { p.defaultValue } -fun wrapDeserializedValueForConstructor(p: PropertyInfo) = +internal fun wrapDeserializedValueForConstructor(p: PropertyInfo) = if (p.nonNullOption) { buildCodeBlock { beginControlFlow("requireNotNull(%N)", p.name) diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/EnumGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/EnumGenerator.kt index 06170c11e..337525291 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/EnumGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/EnumGenerator.kt @@ -28,7 +28,7 @@ import protokt.v1.codegen.generate.CodeGenerator.Context import protokt.v1.codegen.generate.Deprecation.handleDeprecation import protokt.v1.codegen.util.Enum -fun generateEnum(e: Enum, ctx: Context) = +internal fun generateEnum(e: Enum, ctx: Context) = if (ctx.info.context.generateTypes) { EnumGenerator(e, ctx).generate() } else { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileDescriptorResolver.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileDescriptorResolver.kt index e3cf735b3..33261ab68 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileDescriptorResolver.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileDescriptorResolver.kt @@ -38,7 +38,7 @@ class FileDescriptorInfo( val properties: List ) -class FileDescriptorResolver +internal class FileDescriptorResolver private constructor( private val contents: ProtoFileContents ) { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileGenerator.kt index ffa744b4d..a63a690ea 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/FileGenerator.kt @@ -19,7 +19,7 @@ import com.squareup.kotlinpoet.FileSpec import protokt.v1.codegen.generate.Deprecation.addDeprecationSuppression import protokt.v1.codegen.util.ProtoFileContents -fun generateFile(contents: ProtoFileContents) = +internal fun generateFile(contents: ProtoFileContents) = FileGenerator(contents).generate() private class FileGenerator( diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Implements.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Implements.kt index 4d14b33b2..3ba0b3ef2 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Implements.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Implements.kt @@ -21,7 +21,7 @@ import protokt.v1.codegen.generate.CodeGenerator.Context import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.StandardField -object Implements { +internal object Implements { fun StandardField.overrides( ctx: Context, msg: Message diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/KotlinPoetUtil.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/KotlinPoetUtil.kt index c266eea15..066ebf46a 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/KotlinPoetUtil.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/KotlinPoetUtil.kt @@ -26,7 +26,7 @@ import com.squareup.kotlinpoet.asTypeName import protokt.v1.Collections import protokt.v1.SizeCodecs import protokt.v1.codegen.generate.CodeGenerator.Context -import protokt.v1.codegen.util.inferClassName +import protokt.v1.reflect.inferClassName import kotlin.reflect.KClass import kotlin.reflect.KFunction1 diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MapEntryGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MapEntryGenerator.kt index 4f663e236..5a64de5ca 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MapEntryGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MapEntryGenerator.kt @@ -31,9 +31,11 @@ import protokt.v1.codegen.generate.Wrapper.interceptDefaultValue import protokt.v1.codegen.generate.Wrapper.interceptTypeName import protokt.v1.codegen.generate.Wrapper.wrapField import protokt.v1.codegen.util.DESERIALIZER -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Message +import protokt.v1.codegen.util.SizeFn import protokt.v1.codegen.util.StandardField +import protokt.v1.codegen.util.sizeFn +import protokt.v1.reflect.FieldType import kotlin.reflect.KProperty0 internal fun generateMapEntry(msg: Message, ctx: Context) = @@ -117,10 +119,10 @@ private class MapEntryGenerator( .addFunction( buildFunSpec("entrySize") { returns(Int::class) - if (key.type.sizeFn is FieldType.Method) { + if (key.type.sizeFn is SizeFn.Method) { addParameter("key", keyTypeName) } - if (value.type.sizeFn is FieldType.Method) { + if (value.type.sizeFn is SizeFn.Method) { addParameter("value", valueTypeName) } addStatement("return %L + %L", sizeOf(key, ctx), sizeOf(value, ctx)) @@ -201,14 +203,14 @@ private class MapEntryGenerator( } internal fun sizeOfCall(key: StandardField, value: StandardField, keyStr: CodeBlock, valueStr: CodeBlock) = - if (key.type.sizeFn is FieldType.Method) { - if (value.type.sizeFn is FieldType.Method) { + if (key.type.sizeFn is SizeFn.Method) { + if (value.type.sizeFn is SizeFn.Method) { CodeBlock.of("entrySize(%L,·%L)", keyStr, valueStr) } else { CodeBlock.of("entrySize(%L)", keyStr) } } else { - if (value.type.sizeFn is FieldType.Method) { + if (value.type.sizeFn is SizeFn.Method) { CodeBlock.of("entrySize(%L)", valueStr) } else { CodeBlock.of("entrySize()") diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageDocumentationAnnotator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageDocumentationAnnotator.kt index a0038773e..7cad2342a 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageDocumentationAnnotator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageDocumentationAnnotator.kt @@ -20,10 +20,10 @@ import com.google.protobuf.DescriptorProtos.FileDescriptorProto.MESSAGE_TYPE_FIE import com.google.protobuf.DescriptorProtos.SourceCodeInfo.Location import protokt.v1.codegen.generate.CodeGenerator.Context -fun annotateMessageDocumentation(ctx: Context) = +internal fun annotateMessageDocumentation(ctx: Context) = baseLocation(ctx)?.cleanDocumentation() -fun baseLocation(ctx: Context, extraPath: List = emptyList()) = +internal fun baseLocation(ctx: Context, extraPath: List = emptyList()) = ctx.info.sourceCodeInfo.locationList.firstOrNull { it.pathList == basePath(ctx) + extraPath } private fun basePath(ctx: Context): List { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt index 59b078615..aaaa77236 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageGenerator.kt @@ -34,7 +34,7 @@ import protokt.v1.codegen.generate.Deprecation.handleDeprecation import protokt.v1.codegen.generate.Implements.handleSuperInterface import protokt.v1.codegen.util.Message -fun generateMessage(msg: Message, ctx: Context) = +internal fun generateMessage(msg: Message, ctx: Context) = if (ctx.info.context.generateTypes) { MessageGenerator(msg, ctx).generate() } else { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageSizeGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageSizeGenerator.kt index c1a737a93..c30a97008 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageSizeGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/MessageSizeGenerator.kt @@ -24,14 +24,15 @@ import protokt.v1.codegen.generate.Nullability.hasNonNullOption import protokt.v1.codegen.generate.Wrapper.interceptFieldSizeof import protokt.v1.codegen.generate.Wrapper.interceptSizeof import protokt.v1.codegen.generate.Wrapper.interceptValueAccess -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.Oneof +import protokt.v1.codegen.util.SizeFn import protokt.v1.codegen.util.StandardField +import protokt.v1.codegen.util.sizeFn internal const val MESSAGE_SIZE = "`\$messageSize`" -fun generateMessageSize(msg: Message, properties: List, ctx: Context) = +internal fun generateMessageSize(msg: Message, properties: List, ctx: Context) = MessageSizeGenerator(msg, properties, ctx).generate() private class MessageSizeGenerator( @@ -104,7 +105,7 @@ private class MessageSizeGenerator( } } -fun sizeOf( +internal fun sizeOf( f: StandardField, ctx: Context, oneOfFieldAccess: CodeBlock? = null @@ -172,7 +173,7 @@ private fun sizeOfMap(f: StandardField, name: CodeBlock): CodeBlock { } private fun StandardField.loopVar(name: String) = - if (type.sizeFn is FieldType.Method) { + if (type.sizeFn is SizeFn.Method) { name } else { "_" @@ -180,18 +181,18 @@ private fun StandardField.loopVar(name: String) = private fun StandardField.sizeOf(value: CodeBlock): CodeBlock = when (val fn = type.sizeFn) { - is FieldType.Const -> CodeBlock.of(fn.size.toString()) - is FieldType.Method -> CodeBlock.of("%M(%L)", fn.method, value) + is SizeFn.Const -> CodeBlock.of(fn.size.toString()) + is SizeFn.Method -> CodeBlock.of("%M(%L)", fn.method, value) } -fun StandardField.elementsSize( +internal fun StandardField.elementsSize( fieldAccess: CodeBlock = CodeBlock.of("it"), parenthesize: Boolean = true ) = when (val sizeFn = type.sizeFn) { - is FieldType.Const -> + is SizeFn.Const -> CodeBlock.of("(%N.size * %L)", fieldName, sizeFn.size) .let { if (parenthesize) CodeBlock.of("(%L)", it) else it } - is FieldType.Method -> + is SizeFn.Method -> CodeBlock.of("%N.sumOf·{·%L·}", fieldName, sizeOf(fieldAccess)) } diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Nullability.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Nullability.kt index 728e97f2f..48110e48c 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Nullability.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Nullability.kt @@ -18,11 +18,11 @@ package protokt.v1.codegen.generate import com.squareup.kotlinpoet.TypeName import protokt.v1.codegen.generate.Wrapper.wrapped import protokt.v1.codegen.util.Field -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField +import protokt.v1.reflect.FieldType -object Nullability { +internal object Nullability { val Field.hasNonNullOption get() = when (this) { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/OneofGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/OneofGenerator.kt index ba9c1d646..3b1f09406 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/OneofGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/OneofGenerator.kt @@ -30,7 +30,7 @@ import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField -fun annotateOneofs(msg: Message, ctx: Context) = +internal fun annotateOneofs(msg: Message, ctx: Context) = OneofGenerator(msg, ctx).generate() private class OneofGenerator( diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyAnnotator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyAnnotator.kt index 6066c1546..3f4aca019 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyAnnotator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyAnnotator.kt @@ -33,10 +33,11 @@ import protokt.v1.codegen.generate.Wrapper.wrapped import protokt.v1.codegen.generate.Wrapper.wrapperRequiresNullability import protokt.v1.codegen.util.ErrorContext.withFieldName import protokt.v1.codegen.util.Field -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField +import protokt.v1.codegen.util.defaultValue +import protokt.v1.reflect.FieldType internal fun annotateProperties(msg: Message, ctx: Context) = PropertyAnnotator(msg, ctx).annotate() @@ -132,7 +133,7 @@ private class PropertyAnnotator( } } -class PropertyInfo( +internal class PropertyInfo( val name: String, val number: Int? = null, val propertyType: TypeName, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyDocumentationAnnotator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyDocumentationAnnotator.kt index cccd167b4..68f35d9f8 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyDocumentationAnnotator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/PropertyDocumentationAnnotator.kt @@ -22,7 +22,7 @@ import protokt.v1.codegen.util.Field import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField -fun annotatePropertyDocumentation(field: Field, ctx: Context) = +internal fun annotatePropertyDocumentation(field: Field, ctx: Context) = PropertyDocumentationAnnotator(field, ctx).annotate() private class PropertyDocumentationAnnotator( diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializeAndSizeSupport.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializeAndSizeSupport.kt index d57c7549c..9f11295f2 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializeAndSizeSupport.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializeAndSizeSupport.kt @@ -23,12 +23,13 @@ import protokt.v1.codegen.generate.Nullability.hasNonNullOption import protokt.v1.codegen.generate.Nullability.nullable import protokt.v1.codegen.generate.Wrapper.interceptValueAccess import protokt.v1.codegen.generate.Wrapper.wrapperRequiresNullability -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.Message import protokt.v1.codegen.util.Oneof import protokt.v1.codegen.util.StandardField +import protokt.v1.codegen.util.defaultValue +import protokt.v1.reflect.FieldType -fun Message.mapFields( +internal fun Message.mapFields( ctx: Context, properties: List, skipConditionalForUnpackedRepeatedFields: Boolean, @@ -122,5 +123,5 @@ private fun oneofInstanceConditionals(f: Oneof, stmt: (StandardField) -> CodeBlo } } -fun Oneof.qualify(f: StandardField) = +internal fun Oneof.qualify(f: StandardField) = className.nestedClass(fieldTypeNames.getValue(f.fieldName)) diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt index 70c611e07..81348fe3b 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/SerializerGenerator.kt @@ -29,7 +29,7 @@ import protokt.v1.codegen.util.StandardField internal val WRITER = Writer::class.simpleName!!.lowercase() -fun generateSerializer(msg: Message, properties: List, ctx: Context) = +internal fun generateSerializer(msg: Message, properties: List, ctx: Context) = SerializerGenerator(msg, properties, ctx).generate() private class SerializerGenerator( @@ -56,7 +56,7 @@ private class SerializerGenerator( } } -fun serialize( +internal fun serialize( f: StandardField, ctx: Context, p: PropertySpec, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/ServiceGenerator.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/ServiceGenerator.kt index a77da3924..9b7e83c0b 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/ServiceGenerator.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/ServiceGenerator.kt @@ -57,7 +57,7 @@ import kotlin.reflect.KClass import kotlin.reflect.KFunction1 import kotlin.reflect.KFunction3 -fun generateService(s: Service, ctx: Context, kotlinPlugin: KotlinPlugin?) = +internal fun generateService(s: Service, ctx: Context, kotlinPlugin: KotlinPlugin?) = ServiceGenerator(s, ctx, kotlinPlugin).generate() private class ServiceGenerator( diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Wrapper.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Wrapper.kt index 6892a7aaa..528e4b322 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Wrapper.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/Wrapper.kt @@ -25,13 +25,13 @@ import protokt.v1.Converter import protokt.v1.OptimizedSizeOfConverter import protokt.v1.codegen.generate.CodeGenerator.Context import protokt.v1.codegen.generate.Nullability.hasNonNullOption -import protokt.v1.codegen.generate.WellKnownTypes.wrapWithWellKnownInterception -import protokt.v1.codegen.util.ClassLookup -import protokt.v1.codegen.util.ConverterDetails -import protokt.v1.codegen.util.FieldType import protokt.v1.codegen.util.GeneratorContext import protokt.v1.codegen.util.StandardField -import protokt.v1.codegen.util.inferClassName +import protokt.v1.reflect.ClassLookup +import protokt.v1.reflect.ConverterDetails +import protokt.v1.reflect.FieldType +import protokt.v1.reflect.WellKnownTypes.wrapWithWellKnownInterception +import protokt.v1.reflect.inferClassName import kotlin.reflect.KFunction2 internal object Wrapper { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassNames.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassNames.kt index 4c86b0326..1f7aa71a8 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassNames.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassNames.kt @@ -20,7 +20,7 @@ import com.squareup.kotlinpoet.ClassName const val DESERIALIZER = "Deserializer" const val BUILDER = "Builder" -fun GeneratorContext.className(simpleNames: List) = +internal fun GeneratorContext.className(simpleNames: List) = ClassName(kotlinPackage, simpleNames) fun inferClassName(className: String, pkg: String): Pair> { diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/EnumParser.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/EnumParser.kt index 32e3803f1..381b07786 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/EnumParser.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/EnumParser.kt @@ -19,7 +19,7 @@ import com.google.common.base.CaseFormat import com.google.protobuf.DescriptorProtos.EnumDescriptorProto import com.toasttab.protokt.v1.ProtoktProtos -class EnumParser( +internal class EnumParser( private val ctx: GeneratorContext, private val idx: Int, private val desc: EnumDescriptorProto, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldParser.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldParser.kt index 364bae2ce..b27f40680 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldParser.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldParser.kt @@ -29,8 +29,10 @@ import com.squareup.kotlinpoet.ClassName import com.toasttab.protokt.v1.ProtoktProtos import protokt.v1.codegen.generate.Wrapper.wrapperRequiresNonNullOptionForNonNullity import protokt.v1.codegen.util.ErrorContext.withFieldName +import protokt.v1.reflect.FieldType +import protokt.v1.reflect.typeName -class FieldParser( +internal class FieldParser( private val ctx: GeneratorContext, private val desc: DescriptorProto, private val enclosingMessages: List, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldTypeExt.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldTypeExt.kt new file mode 100644 index 000000000..3891b031c --- /dev/null +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldTypeExt.kt @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.codegen.util + +import com.squareup.kotlinpoet.CodeBlock +import com.squareup.kotlinpoet.MemberName +import com.squareup.kotlinpoet.MemberName.Companion.member +import com.squareup.kotlinpoet.asTypeName +import protokt.v1.SizeCodecs +import protokt.v1.codegen.generate.sizeOf +import protokt.v1.reflect.FieldType + +sealed interface SizeFn { + class Const(val size: Int) : SizeFn + class Method(val method: MemberName) : SizeFn +} + +internal val FieldType.sizeFn + get() = when (this) { + FieldType.Bool -> SizeFn.Const(1) + FieldType.Double, FieldType.Fixed64, FieldType.SFixed64 -> SizeFn.Const(8) + FieldType.Float, FieldType.Fixed32, FieldType.SFixed32 -> SizeFn.Const(4) + FieldType.SInt32 -> SizeFn.Method(SizeCodecs::class.asTypeName().member(SizeCodecs::sizeOfSInt32.name)) + FieldType.SInt64 -> SizeFn.Method(SizeCodecs::class.asTypeName().member(SizeCodecs::sizeOfSInt64.name)) + else -> SizeFn.Method(sizeOf) + } + +internal val FieldType.defaultValue: CodeBlock + get() = when (this) { + FieldType.Message -> CodeBlock.of("null") + FieldType.Enum -> error("enums defaults are discovered external to this property; this is bug in the code generator") + FieldType.Bool -> CodeBlock.of("false") + FieldType.Fixed32, FieldType.UInt32 -> CodeBlock.of("0u") + FieldType.Int32, FieldType.SFixed32, FieldType.SInt32 -> CodeBlock.of("0") + FieldType.Fixed64, FieldType.UInt64 -> CodeBlock.of("0uL") + FieldType.Int64, FieldType.SFixed64, FieldType.SInt64 -> CodeBlock.of("0L") + FieldType.Float -> CodeBlock.of("0.0f") + FieldType.Double -> CodeBlock.of("0.0") + FieldType.Bytes -> CodeBlock.of("%T.empty()", protokt.v1.Bytes::class) + FieldType.String -> CodeBlock.of("\"\"") + } diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FileContentParser.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FileContentParser.kt index a554d3b90..b712dbe33 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FileContentParser.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FileContentParser.kt @@ -22,13 +22,13 @@ import protokt.v1.codegen.util.ErrorContext.withEnumName import protokt.v1.codegen.util.ErrorContext.withMessageName import protokt.v1.codegen.util.ErrorContext.withServiceName -fun parseFileContents(ctx: GeneratorContext) = +internal fun parseFileContents(ctx: GeneratorContext) = ProtoFileContents( ProtoFileInfo(ctx), FileContentParser(ctx).parseContents() ) -class FileContentParser( +internal class FileContentParser( private val ctx: GeneratorContext, private val enums: List, private val messages: List, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratedCodeCleanup.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratedCodeCleanup.kt index 282e4a736..67b4dc359 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratedCodeCleanup.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratedCodeCleanup.kt @@ -28,7 +28,7 @@ import protokt.v1.codegen.generate.INDENT private val logger = KotlinLogging.logger { } -fun tidy(code: String, context: GeneratorContext) = +internal fun tidy(code: String, context: GeneratorContext) = if (context.formatOutput) { try { format(code) diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratorContext.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratorContext.kt index 6fb228d58..8d82186fe 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratorContext.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GeneratorContext.kt @@ -19,7 +19,7 @@ import com.google.protobuf.DescriptorProtos.FileDescriptorProto import com.toasttab.protokt.v1.ProtoktProtos import protokt.v1.gradle.PROTOKT_VERSION -class GeneratorContext( +internal class GeneratorContext( val fdp: FileDescriptorProto, params: PluginParams, allFiles: List diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GrpcKotlinGeneratorSupport.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GrpcKotlinGeneratorSupport.kt index c79d65023..026a4d9bd 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GrpcKotlinGeneratorSupport.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/GrpcKotlinGeneratorSupport.kt @@ -18,10 +18,11 @@ package protokt.v1.codegen.util import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse import io.grpc.kotlin.generator.GeneratorRunner +import protokt.v1.reflect.resolvePackage import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream -fun generateGrpcKotlinStubs( +internal fun generateGrpcKotlinStubs( params: PluginParams, request: CodeGeneratorRequest ): List = diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/MessageParser.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/MessageParser.kt index e95896cb0..51a2a63bc 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/MessageParser.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/MessageParser.kt @@ -18,7 +18,7 @@ package protokt.v1.codegen.util import com.google.protobuf.DescriptorProtos.DescriptorProto import com.toasttab.protokt.v1.ProtoktProtos -class MessageParser( +internal class MessageParser( private val ctx: GeneratorContext, private val idx: Int, private val desc: DescriptorProto, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PackageResolution.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PackageResolution.kt index 11a2ed6fd..60f18ac22 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PackageResolution.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PackageResolution.kt @@ -16,40 +16,11 @@ package protokt.v1.codegen.util import com.google.protobuf.DescriptorProtos.FileDescriptorProto -import protokt.v1.Bytes +import protokt.v1.reflect.DOT_GOOGLE_PROTOBUF +import protokt.v1.reflect.PROTOKT_V1 +import protokt.v1.reflect.resolvePackage -val PROTOKT_V1 = Bytes::class.java.`package`.name -const val DOT_GOOGLE_PROTOBUF = ".google.protobuf" val PROTOKT_V1_GOOGLE_PROTO = PROTOKT_V1 + DOT_GOOGLE_PROTOBUF fun packagesByFileName(protoFileList: List) = protoFileList.associate { it.name to resolvePackage(it.`package`) } - -fun resolvePackage(pkg: String) = - if (pkg.startsWith(PROTOKT_V1)) { - pkg - } else { - "$PROTOKT_V1.$pkg" - } - -fun requalifyProtoType(typeName: String): String = - // type name might have a `.` prefix - if (typeName.startsWith(".$PROTOKT_V1")) { - typeName.removePrefix(".") - } else { - "$PROTOKT_V1." + typeName.removePrefix(".") - } - -internal fun typeName(protoTypeName: String, fieldType: FieldType): String { - val fullyProtoQualified = protoTypeName.startsWith(".") - - return if (fullyProtoQualified) { - requalifyProtoType(protoTypeName) - } else { - protoTypeName.let { - it.ifEmpty { - fieldType.protoktFieldType.qualifiedName!! - } - } - } -} diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PluginParams.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PluginParams.kt index e2ce16e45..92e20728e 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PluginParams.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/PluginParams.kt @@ -26,10 +26,11 @@ import protokt.v1.gradle.GENERATE_TYPES import protokt.v1.gradle.KOTLIN_EXTRA_CLASSPATH import protokt.v1.gradle.ProtoktExtension import protokt.v1.gradle.ProtoktExtension.Generate +import protokt.v1.reflect.ClassLookup import java.net.URLDecoder import kotlin.reflect.full.declaredMemberProperties -class PluginParams( +internal class PluginParams( params: Map ) { val classLookup = diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ServiceParser.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ServiceParser.kt index 017afe64f..88b7ff5ab 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ServiceParser.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ServiceParser.kt @@ -19,6 +19,7 @@ import com.google.protobuf.DescriptorProtos.MethodDescriptorProto import com.google.protobuf.DescriptorProtos.ServiceDescriptorProto import com.squareup.kotlinpoet.ClassName import com.toasttab.protokt.v1.ProtoktProtos +import protokt.v1.reflect.requalifyProtoType class ServiceParser( private val idx: Int, diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/Types.kt b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/Types.kt index e71bbc576..c7d0aedbb 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/Types.kt +++ b/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/Types.kt @@ -19,6 +19,7 @@ import com.google.protobuf.DescriptorProtos import com.squareup.kotlinpoet.ClassName import com.squareup.kotlinpoet.TypeSpec import com.toasttab.protokt.v1.ProtoktProtos +import protokt.v1.reflect.FieldType sealed class TopLevelType @@ -96,7 +97,7 @@ sealed class Field { abstract val fieldName: String } -class StandardField( +internal class StandardField( val number: Int, val tag: Tag, @@ -126,7 +127,7 @@ class StandardField( get() = mapEntry!!.fields[1] as StandardField } -class Oneof( +internal class Oneof( val name: String, val className: ClassName, override val fieldName: String, @@ -147,7 +148,7 @@ class OneofOptions( val protokt: ProtoktProtos.OneofOptions ) -class ProtoFileInfo( +internal class ProtoFileInfo( val context: GeneratorContext ) { val name = context.fdp.name @@ -162,7 +163,7 @@ class FileOptions( val protokt: ProtoktProtos.FileOptions ) -class ProtoFileContents( +internal class ProtoFileContents( val info: ProtoFileInfo, val types: List ) diff --git a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt index ab239ffc3..fd5b655be 100644 --- a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt +++ b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/AbstractProtoktCodegenTest.kt @@ -121,7 +121,7 @@ private val binGenerator = File(codegenTestingResources.toFile(), "bin-generator") private val extensionsProto = - Path.of("extensions", "protokt-extensions-lite", "src", "main", "proto") + Path.of("extensions", "protokt-extensions-lite", "src", "extensions-proto") private val includeProtos = File(projectRoot, "build/extracted-include-protos/main") diff --git a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/NonNullValidationTest.kt b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/NonNullValidationTest.kt index 42b3745f8..5f2b694ea 100644 --- a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/NonNullValidationTest.kt +++ b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/NonNullValidationTest.kt @@ -19,7 +19,7 @@ import com.google.common.truth.Truth import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource -import protokt.v1.codegen.util.FieldType +import protokt.v1.reflect.FieldType class NonNullValidationTest : AbstractProtoktCodegenTest() { @ParameterizedTest diff --git a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/ProtoktCodegenTest.kt b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/ProtoktCodegenTest.kt index 809c056e2..d61c3a8b9 100644 --- a/protokt-codegen/src/test/kotlin/protokt/v1/codegen/ProtoktCodegenTest.kt +++ b/protokt-codegen/src/test/kotlin/protokt/v1/codegen/ProtoktCodegenTest.kt @@ -16,6 +16,12 @@ package protokt.v1.codegen import org.junit.jupiter.api.Test +import protokt.v1.AbstractConverter +import protokt.v1.Bytes +import protokt.v1.OptimizedSizeOfConverter +import protokt.v1.SizeCodecs +import java.nio.ByteBuffer +import java.util.UUID class ProtoktCodegenTest : AbstractProtoktCodegenTest() { @Test @@ -30,3 +36,30 @@ class ProtoktCodegenTest : AbstractProtoktCodegenTest() { } } } + +object UuidBytesConverter : AbstractConverter(), OptimizedSizeOfConverter { + override val acceptsDefaultValue = false + + private val sizeOfProxy = ByteArray(16) + + override fun sizeOf(wrapped: UUID) = + SizeCodecs.sizeOf(sizeOfProxy) + + override fun wrap(unwrapped: Bytes): UUID { + val buf = unwrapped.asReadOnlyBuffer() + + require(buf.remaining() == 16) { + "UUID source must have size 16; had ${buf.remaining()}" + } + + return buf.run { UUID(long, long) } + } + + override fun unwrap(wrapped: UUID): Bytes = + Bytes.from( + ByteBuffer.allocate(16) + .putLong(wrapped.mostSignificantBits) + .putLong(wrapped.leastSignificantBits) + .array() + ) +} diff --git a/protokt-codegen/src/test/resources/META-INF/services/protokt.v1.Converter b/protokt-codegen/src/test/resources/META-INF/services/protokt.v1.Converter new file mode 100644 index 000000000..a7d962639 --- /dev/null +++ b/protokt-codegen/src/test/resources/META-INF/services/protokt.v1.Converter @@ -0,0 +1 @@ +protokt.v1.codegen.UuidBytesConverter diff --git a/protokt-codegen/src/test/resources/test.proto b/protokt-codegen/src/test/resources/test.proto index 44b8aa5ea..eaf1c4d61 100644 --- a/protokt-codegen/src/test/resources/test.proto +++ b/protokt-codegen/src/test/resources/test.proto @@ -17,8 +17,21 @@ syntax = "proto3"; package toasttab.protokt.v1.codegen.testing; +import "google/protobuf/empty.proto"; +import "google/protobuf/wrappers.proto"; +import "protokt/v1/protokt.proto"; + message TestMessage { - string value = 1; + // google.protobuf.DoubleValue double = 1; + map map = 1; + + /* + map map_int_value_wrapped = 4 [ + (.protokt.v1.property).value_wrap = "java.util.UUID" + ]; + */ } +/* message Empty {} + */ diff --git a/protokt-core/src/jvmMain/kotlin/protokt/v1/google/protobuf/Anies.kt b/protokt-core/src/jvmMain/kotlin/protokt/v1/google/protobuf/Anies.kt index 2baaf7bf5..9a8cecbc0 100644 --- a/protokt-core/src/jvmMain/kotlin/protokt/v1/google/protobuf/Anies.kt +++ b/protokt-core/src/jvmMain/kotlin/protokt/v1/google/protobuf/Anies.kt @@ -49,17 +49,13 @@ inline fun Any.unpack(deserializer: Deserializer): T { return deserializer.deserialize(value) } -@Suppress("DEPRECATION") inline fun Any.isA() = typeUrl.substringAfterLast('/') == ( T::class.java.getAnnotation(GeneratedMessage::class.java)?.fullTypeName - ?: T::class.java.getAnnotation(com.toasttab.protokt.rt.KtGeneratedMessage::class.java)?.fullTypeName ?: error("class ${T::class} has no protokt generated message annotation") ) -@Suppress("DEPRECATION") private fun fullTypeName(klass: KClass<*>) = klass.java.getAnnotation(GeneratedMessage::class.java)?.fullTypeName - ?: klass.java.getAnnotation(com.toasttab.protokt.rt.KtGeneratedMessage::class.java)?.fullTypeName ?: error("class $klass has no protokt generated message annotation") diff --git a/protokt-reflect/api/protokt-reflect.api b/protokt-reflect/api/protokt-reflect.api new file mode 100644 index 000000000..d951bdb00 --- /dev/null +++ b/protokt-reflect/api/protokt-reflect.api @@ -0,0 +1,1245 @@ +public final class com/toasttab/protokt/v1/ProtoktProtos { + public static final field CLASS_FIELD_NUMBER I + public static final field ENUM_FIELD_NUMBER I + public static final field ENUM_VALUE_FIELD_NUMBER I + public static final field FILE_FIELD_NUMBER I + public static final field METHOD_FIELD_NUMBER I + public static final field ONEOF_FIELD_NUMBER I + public static final field PROPERTY_FIELD_NUMBER I + public static final field SERVICE_FIELD_NUMBER I + public static final field class_ Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field enumValue Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field enum_ Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field file Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field method Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field oneof Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field property Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static final field service Lcom/google/protobuf/GeneratedMessage$GeneratedExtension; + public static fun getDescriptor ()Lcom/google/protobuf/Descriptors$FileDescriptor; + public static fun registerAllExtensions (Lcom/google/protobuf/ExtensionRegistry;)V + public static fun registerAllExtensions (Lcom/google/protobuf/ExtensionRegistryLite;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$EnumOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$EnumOptionsOrBuilder { + public static final field DEPRECATION_MESSAGE_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$EnumOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public fun clearDeprecationMessage ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public fun setDeprecationMessage (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public fun setDeprecationMessageBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$EnumOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getDeprecationMessage ()Ljava/lang/String; + public abstract fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$EnumValueOptionsOrBuilder { + public static final field DEPRECATION_MESSAGE_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$EnumValueOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public fun clearDeprecationMessage ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public fun setDeprecationMessage (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public fun setDeprecationMessageBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$EnumValueOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$EnumValueOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getDeprecationMessage ()Ljava/lang/String; + public abstract fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$FieldOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$FieldOptionsOrBuilder { + public static final field BYTES_SLICE_FIELD_NUMBER I + public static final field DEPRECATION_MESSAGE_FIELD_NUMBER I + public static final field KEY_WRAP_FIELD_NUMBER I + public static final field NON_NULL_FIELD_NUMBER I + public static final field VALUE_WRAP_FIELD_NUMBER I + public static final field WRAP_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public fun getBytesSlice ()Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getKeyWrap ()Ljava/lang/String; + public fun getKeyWrapBytes ()Lcom/google/protobuf/ByteString; + public fun getNonNull ()Z + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun getValueWrap ()Ljava/lang/String; + public fun getValueWrapBytes ()Lcom/google/protobuf/ByteString; + public fun getWrap ()Ljava/lang/String; + public fun getWrapBytes ()Lcom/google/protobuf/ByteString; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$FieldOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearBytesSlice ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearDeprecationMessage ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearKeyWrap ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearNonNull ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearValueWrap ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun clearWrap ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public fun getBytesSlice ()Z + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getKeyWrap ()Ljava/lang/String; + public fun getKeyWrapBytes ()Lcom/google/protobuf/ByteString; + public fun getNonNull ()Z + public fun getValueWrap ()Ljava/lang/String; + public fun getValueWrapBytes ()Lcom/google/protobuf/ByteString; + public fun getWrap ()Ljava/lang/String; + public fun getWrapBytes ()Lcom/google/protobuf/ByteString; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setBytesSlice (Z)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setDeprecationMessage (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setDeprecationMessageBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setKeyWrap (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setKeyWrapBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setNonNull (Z)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setValueWrap (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setValueWrapBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setWrap (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; + public fun setWrapBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FieldOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$FieldOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getBytesSlice ()Z + public abstract fun getDeprecationMessage ()Ljava/lang/String; + public abstract fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getKeyWrap ()Ljava/lang/String; + public abstract fun getKeyWrapBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getNonNull ()Z + public abstract fun getValueWrap ()Ljava/lang/String; + public abstract fun getValueWrapBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getWrap ()Ljava/lang/String; + public abstract fun getWrapBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$FileOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$FileOptionsOrBuilder { + public static final field FILE_DESCRIPTOR_OBJECT_NAME_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getFileDescriptorObjectName ()Ljava/lang/String; + public fun getFileDescriptorObjectNameBytes ()Lcom/google/protobuf/ByteString; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$FileOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public fun clearFileDescriptorObjectName ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getFileDescriptorObjectName ()Ljava/lang/String; + public fun getFileDescriptorObjectNameBytes ()Lcom/google/protobuf/ByteString; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public fun setFileDescriptorObjectName (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public fun setFileDescriptorObjectNameBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$FileOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$FileOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getFileDescriptorObjectName ()Ljava/lang/String; + public abstract fun getFileDescriptorObjectNameBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$MessageOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$MessageOptionsOrBuilder { + public static final field DEPRECATION_MESSAGE_FIELD_NUMBER I + public static final field IMPLEMENTS_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getImplements ()Ljava/lang/String; + public fun getImplementsBytes ()Lcom/google/protobuf/ByteString; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$MessageOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun clearDeprecationMessage ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun clearImplements ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getImplements ()Ljava/lang/String; + public fun getImplementsBytes ()Lcom/google/protobuf/ByteString; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun setDeprecationMessage (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun setDeprecationMessageBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun setImplements (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public fun setImplementsBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$MessageOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$MessageOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getDeprecationMessage ()Ljava/lang/String; + public abstract fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getImplements ()Ljava/lang/String; + public abstract fun getImplementsBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$MethodOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$MethodOptionsOrBuilder { + public static final field REQUEST_MARSHALLER_FIELD_NUMBER I + public static final field RESPONSE_MARSHALLER_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getRequestMarshaller ()Ljava/lang/String; + public fun getRequestMarshallerBytes ()Lcom/google/protobuf/ByteString; + public fun getResponseMarshaller ()Ljava/lang/String; + public fun getResponseMarshallerBytes ()Lcom/google/protobuf/ByteString; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$MethodOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun clearRequestMarshaller ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun clearResponseMarshaller ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getRequestMarshaller ()Ljava/lang/String; + public fun getRequestMarshallerBytes ()Lcom/google/protobuf/ByteString; + public fun getResponseMarshaller ()Ljava/lang/String; + public fun getResponseMarshallerBytes ()Lcom/google/protobuf/ByteString; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun setRequestMarshaller (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun setRequestMarshallerBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun setResponseMarshaller (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public fun setResponseMarshallerBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$MethodOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$MethodOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getRequestMarshaller ()Ljava/lang/String; + public abstract fun getRequestMarshallerBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getResponseMarshaller ()Ljava/lang/String; + public abstract fun getResponseMarshallerBytes ()Lcom/google/protobuf/ByteString; +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$OneofOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$OneofOptionsOrBuilder { + public static final field DEPRECATION_MESSAGE_FIELD_NUMBER I + public static final field IMPLEMENTS_FIELD_NUMBER I + public static final field NON_NULL_FIELD_NUMBER I + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getImplements ()Ljava/lang/String; + public fun getImplementsBytes ()Lcom/google/protobuf/ByteString; + public fun getNonNull ()Z + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$OneofOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun clearDeprecationMessage ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun clearImplements ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun clearNonNull ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions; + public fun getDeprecationMessage ()Ljava/lang/String; + public fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getImplements ()Ljava/lang/String; + public fun getImplementsBytes ()Lcom/google/protobuf/ByteString; + public fun getNonNull ()Z + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun setDeprecationMessage (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun setDeprecationMessageBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun setImplements (Ljava/lang/String;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun setImplementsBytes (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public fun setNonNull (Z)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$OneofOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$OneofOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { + public abstract fun getDeprecationMessage ()Ljava/lang/String; + public abstract fun getDeprecationMessageBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getImplements ()Ljava/lang/String; + public abstract fun getImplementsBytes ()Lcom/google/protobuf/ByteString; + public abstract fun getNonNull ()Z +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$ServiceOptions : com/google/protobuf/GeneratedMessageV3, com/toasttab/protokt/v1/ProtoktProtos$ServiceOptionsOrBuilder { + public fun equals (Ljava/lang/Object;)Z + public static fun getDefaultInstance ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getParserForType ()Lcom/google/protobuf/Parser; + public fun getSerializedSize ()I + public final fun getUnknownFields ()Lcom/google/protobuf/UnknownFieldSet; + public fun hashCode ()I + public final fun isInitialized ()Z + public static fun newBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public static fun newBuilder (Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/Message$Builder; + public synthetic fun newBuilderForType ()Lcom/google/protobuf/MessageLite$Builder; + public fun newBuilderForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public static fun parseDelimitedFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseDelimitedFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Lcom/google/protobuf/ByteString;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Ljava/io/InputStream;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Ljava/io/InputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom (Ljava/nio/ByteBuffer;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom ([B)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parseFrom ([BLcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static fun parser ()Lcom/google/protobuf/Parser; + public synthetic fun toBuilder ()Lcom/google/protobuf/Message$Builder; + public synthetic fun toBuilder ()Lcom/google/protobuf/MessageLite$Builder; + public fun toBuilder ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public fun writeTo (Lcom/google/protobuf/CodedOutputStream;)V +} + +public final class com/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder : com/google/protobuf/GeneratedMessageV3$Builder, com/toasttab/protokt/v1/ProtoktProtos$ServiceOptionsOrBuilder { + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun addRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun build ()Lcom/google/protobuf/Message; + public synthetic fun build ()Lcom/google/protobuf/MessageLite; + public fun build ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public synthetic fun buildPartial ()Lcom/google/protobuf/Message; + public synthetic fun buildPartial ()Lcom/google/protobuf/MessageLite; + public fun buildPartial ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public synthetic fun clear ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clear ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clear ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clear ()Lcom/google/protobuf/MessageLite$Builder; + public fun clear ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearField (Lcom/google/protobuf/Descriptors$FieldDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/google/protobuf/Message$Builder; + public fun clearOneof (Lcom/google/protobuf/Descriptors$OneofDescriptor;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun clone ()Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun clone ()Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun clone ()Lcom/google/protobuf/Message$Builder; + public synthetic fun clone ()Lcom/google/protobuf/MessageLite$Builder; + public fun clone ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun clone ()Ljava/lang/Object; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/Message; + public synthetic fun getDefaultInstanceForType ()Lcom/google/protobuf/MessageLite; + public fun getDefaultInstanceForType ()Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions; + public static final fun getDescriptor ()Lcom/google/protobuf/Descriptors$Descriptor; + public fun getDescriptorForType ()Lcom/google/protobuf/Descriptors$Descriptor; + public final fun isInitialized ()Z + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/AbstractMessageLite$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/Message$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/google/protobuf/MessageLite$Builder; + public fun mergeFrom (Lcom/google/protobuf/CodedInputStream;Lcom/google/protobuf/ExtensionRegistryLite;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/google/protobuf/Message$Builder; + public fun mergeFrom (Lcom/google/protobuf/Message;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public fun mergeFrom (Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/AbstractMessage$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun mergeUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setField (Lcom/google/protobuf/Descriptors$FieldDescriptor;Ljava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/google/protobuf/Message$Builder; + public fun setRepeatedField (Lcom/google/protobuf/Descriptors$FieldDescriptor;ILjava/lang/Object;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/GeneratedMessageV3$Builder; + public synthetic fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/google/protobuf/Message$Builder; + public final fun setUnknownFields (Lcom/google/protobuf/UnknownFieldSet;)Lcom/toasttab/protokt/v1/ProtoktProtos$ServiceOptions$Builder; +} + +public abstract interface class com/toasttab/protokt/v1/ProtoktProtos$ServiceOptionsOrBuilder : com/google/protobuf/MessageOrBuilder { +} + +public final class protokt/v1/EnumOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/EnumOptions$Deserializer; + public synthetic fun (Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/EnumOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/EnumOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/EnumOptions; + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setDeprecationMessage (Ljava/lang/String;)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/EnumOptions$Deserializer : protokt/v1/AbstractDeserializer { + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/EnumOptions; + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumOptions; +} + +public final class protokt/v1/EnumValueOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/EnumValueOptions$Deserializer; + public synthetic fun (Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumValueOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/EnumValueOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumValueOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/EnumValueOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/EnumValueOptions; + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setDeprecationMessage (Ljava/lang/String;)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/EnumValueOptions$Deserializer : protokt/v1/AbstractDeserializer { + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/EnumValueOptions; + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/EnumValueOptions; +} + +public final class protokt/v1/FieldOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/FieldOptions$Deserializer; + public synthetic fun (ZLjava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FieldOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/FieldOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getBytesSlice ()Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getKeyWrap ()Ljava/lang/String; + public final fun getNonNull ()Z + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun getValueWrap ()Ljava/lang/String; + public final fun getWrap ()Ljava/lang/String; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FieldOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/FieldOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/FieldOptions; + public final fun getBytesSlice ()Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getKeyWrap ()Ljava/lang/String; + public final fun getNonNull ()Z + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun getValueWrap ()Ljava/lang/String; + public final fun getWrap ()Ljava/lang/String; + public final fun setBytesSlice (Z)V + public final fun setDeprecationMessage (Ljava/lang/String;)V + public final fun setKeyWrap (Ljava/lang/String;)V + public final fun setNonNull (Z)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V + public final fun setValueWrap (Ljava/lang/String;)V + public final fun setWrap (Ljava/lang/String;)V +} + +public final class protokt/v1/FieldOptions$Deserializer : protokt/v1/AbstractDeserializer { + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/FieldOptions; + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FieldOptions; +} + +public final class protokt/v1/FileOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/FileOptions$Deserializer; + public synthetic fun (Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FileOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/FileOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getFileDescriptorObjectName ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FileOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/FileOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/FileOptions; + public final fun getFileDescriptorObjectName ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setFileDescriptorObjectName (Ljava/lang/String;)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/FileOptions$Deserializer : protokt/v1/AbstractDeserializer { + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/FileOptions; + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/FileOptions; +} + +public final class protokt/v1/MessageOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/MessageOptions$Deserializer; + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MessageOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/MessageOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getImplements ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MessageOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/MessageOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/MessageOptions; + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getImplements ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setDeprecationMessage (Ljava/lang/String;)V + public final fun setImplements (Ljava/lang/String;)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/MessageOptions$Deserializer : protokt/v1/AbstractDeserializer { + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/MessageOptions; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MessageOptions; +} + +public final class protokt/v1/MethodOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/MethodOptions$Deserializer; + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MethodOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/MethodOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getRequestMarshaller ()Ljava/lang/String; + public final fun getResponseMarshaller ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MethodOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/MethodOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/MethodOptions; + public final fun getRequestMarshaller ()Ljava/lang/String; + public final fun getResponseMarshaller ()Ljava/lang/String; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setRequestMarshaller (Ljava/lang/String;)V + public final fun setResponseMarshaller (Ljava/lang/String;)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/MethodOptions$Deserializer : protokt/v1/AbstractDeserializer { + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/MethodOptions; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/MethodOptions; +} + +public final class protokt/v1/OneofOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/OneofOptions$Deserializer; + public synthetic fun (ZLjava/lang/String;Ljava/lang/String;Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/OneofOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/OneofOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getImplements ()Ljava/lang/String; + public final fun getNonNull ()Z + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/OneofOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/OneofOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/OneofOptions; + public final fun getDeprecationMessage ()Ljava/lang/String; + public final fun getImplements ()Ljava/lang/String; + public final fun getNonNull ()Z + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setDeprecationMessage (Ljava/lang/String;)V + public final fun setImplements (Ljava/lang/String;)V + public final fun setNonNull (Z)V + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/OneofOptions$Deserializer : protokt/v1/AbstractDeserializer { + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/OneofOptions; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/OneofOptions; +} + +public final class protokt/v1/ProtoktKt { + public static final fun getDescriptor (Lprotokt/v1/EnumOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/EnumValueOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/FieldOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/FileOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/MessageOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/MethodOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/OneofOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; + public static final fun getDescriptor (Lprotokt/v1/ServiceOptions$Deserializer;)Lprotokt/v1/google/protobuf/Descriptor; +} + +public final class protokt/v1/ProtoktProtos { + public static final field INSTANCE Lprotokt/v1/ProtoktProtos; + public final fun getDescriptor ()Lprotokt/v1/google/protobuf/FileDescriptor; +} + +public final class protokt/v1/ServiceOptions : protokt/v1/AbstractMessage { + public static final field Deserializer Lprotokt/v1/ServiceOptions$Deserializer; + public synthetic fun (Lprotokt/v1/UnknownFieldSet;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/ServiceOptions; + public static fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/ServiceOptions; + public fun equals (Ljava/lang/Object;)Z + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public fun hashCode ()I + public static final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/ServiceOptions; + public fun messageSize ()I + public fun serialize (Lprotokt/v1/Writer;)V + public fun toString ()Ljava/lang/String; +} + +public final class protokt/v1/ServiceOptions$Builder { + public fun ()V + public final fun build ()Lprotokt/v1/ServiceOptions; + public final fun getUnknownFields ()Lprotokt/v1/UnknownFieldSet; + public final fun setUnknownFields (Lprotokt/v1/UnknownFieldSet;)V +} + +public final class protokt/v1/ServiceOptions$Deserializer : protokt/v1/AbstractDeserializer { + public synthetic fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/Message; + public fun deserialize (Lprotokt/v1/Reader;)Lprotokt/v1/ServiceOptions; + public final fun invoke (Lkotlin/jvm/functions/Function1;)Lprotokt/v1/ServiceOptions; +} + +public final class protokt/v1/google/protobuf/Messages { + public static final fun getField (Lprotokt/v1/Message;Lcom/google/protobuf/Descriptors$FieldDescriptor;)Ljava/lang/Object; + public static final fun hasField (Lprotokt/v1/Message;Lcom/google/protobuf/Descriptors$FieldDescriptor;)Z + public static final fun toDynamicMessage (Lprotokt/v1/Message;Lprotokt/v1/google/protobuf/RuntimeContext;)Lcom/google/protobuf/DynamicMessage; +} + +public final class protokt/v1/google/protobuf/RuntimeContext { + public fun (Ljava/lang/Iterable;)V + public final fun convertValue (Ljava/lang/Object;)Ljava/lang/Object; +} + diff --git a/protokt-reflect/build.gradle.kts b/protokt-reflect/build.gradle.kts new file mode 100644 index 000000000..4cbb890c9 --- /dev/null +++ b/protokt-reflect/build.gradle.kts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.google.protobuf.gradle.proto +import protokt.v1.gradle.testProtoktExtensions + +plugins { + id("protokt.multiplatform-conventions") +} + +localProtokt(false) +enablePublishing() +trackKotlinApiCompatibility() + +kotlin { + sourceSets { + val jvmMain by getting { + dependencies { + api(project(":protokt-core")) + api(libs.protobuf.java) + + implementation(kotlin("reflect")) + } + } + } +} + +tasks.withType { enabled = true } + +sourceSets { + main { + java { + srcDir(rootProject.file("shared-src/reflect")) + } + proto { + srcDir("../extensions/protokt-extensions-lite/src/extensions-proto") + } + } +} + +dependencies { + testProtoktExtensions(project(":extensions:protokt-extensions")) +} diff --git a/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/Messages.kt b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/Messages.kt new file mode 100644 index 000000000..2760694fd --- /dev/null +++ b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/Messages.kt @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@file:JvmName("Messages") + +package protokt.v1.google.protobuf + +import com.google.protobuf.Descriptors.FieldDescriptor +import com.google.protobuf.Descriptors.FieldDescriptor.Type +import com.google.protobuf.DynamicMessage +import protokt.v1.Bytes +import protokt.v1.Message + +fun Message.toDynamicMessage(context: RuntimeContext): DynamicMessage = + context.convertValue(this) as DynamicMessage + +fun Message.hasField(field: FieldDescriptor): Boolean { + val value = getField(field) + + return if (field.hasPresence()) { + value != null + } else { + value != defaultValue(field) + } +} + +fun Message.getField(field: FieldDescriptor) = + ProtoktReflect.getField(this, field) + +private fun defaultValue(field: FieldDescriptor) = + when (field.type) { + Type.UINT64, Type.FIXED64 -> 0uL + Type.UINT32, Type.FIXED32 -> 0u + Type.BYTES -> Bytes.empty() + else -> field.defaultValue + } diff --git a/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/ProtoktReflect.kt b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/ProtoktReflect.kt new file mode 100644 index 000000000..88f8745eb --- /dev/null +++ b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/ProtoktReflect.kt @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.google.protobuf + +import com.google.protobuf.Descriptors.FieldDescriptor +import com.google.protobuf.Descriptors.FieldDescriptor.Type +import protokt.v1.Enum +import protokt.v1.Fixed32Val +import protokt.v1.Fixed64Val +import protokt.v1.GeneratedProperty +import protokt.v1.LengthDelimitedVal +import protokt.v1.Message +import protokt.v1.UnknownFieldSet +import protokt.v1.VarintVal +import java.nio.charset.StandardCharsets +import java.util.concurrent.ConcurrentHashMap +import kotlin.Any +import kotlin.reflect.KClass +import kotlin.reflect.KProperty1 +import kotlin.reflect.full.declaredMemberProperties +import kotlin.reflect.full.findAnnotation +import kotlin.reflect.full.isSubclassOf + +internal object ProtoktReflect { + private val reflectedGettersByClass = ConcurrentHashMap, (FieldDescriptor, Message) -> Any?>() + + private fun getReflectedGettersByClass(messageClass: KClass) = + reflectedGettersByClass.computeIfAbsent(messageClass) { + { + field, message -> + topLevelProperty(messageClass)(field, message) + ?: oneofProperty(messageClass)(field, message) + ?: getUnknownField(field, message) + } + } + + private fun topLevelProperty(klass: KClass): (FieldDescriptor, Message) -> Any? { + val gettersByNumber = gettersByNumber(klass) + return { field, instance -> gettersByNumber[field.number]?.invoke(instance) } + } + + private fun gettersByNumber(klass: KClass<*>): Map> = + klass.declaredMemberProperties + .map { it.findAnnotation()?.number to it } + .filter { (number, _) -> number != null } + .associate { (number, getter) -> + @Suppress("UNCHECKED_CAST") + number!! to getter as KProperty1 + } + + private fun oneofProperty(messageClass: KClass): (FieldDescriptor, Message) -> Any? { + val oneofPropertiesSealedClasses = + messageClass + .nestedClasses + .filter { it.isSealed && !it.isSubclassOf(Enum::class) } + + val gettersByNumber = + buildMap { + oneofPropertiesSealedClasses.forEach { sealedClass -> + val oneofPropertyGetter = + messageClass.declaredMemberProperties + .single { it.returnType.classifier == sealedClass } + .let { + @Suppress("UNCHECKED_CAST") + it as KProperty1 + } + + sealedClass.nestedClasses.forEach { sealedClassSubtype -> + val (number, getterFromSubtype) = gettersByNumber(sealedClassSubtype).entries.single() + put(number) { msg: Message -> + val oneofProperty = oneofPropertyGetter.get(msg) + if (sealedClassSubtype.isInstance(oneofProperty)) { + getterFromSubtype(oneofProperty!!) + } else { + null + } + } + } + } + } + + return { field, msg -> gettersByNumber[field.number]?.invoke(msg) } + } + + private fun getUnknownField(field: FieldDescriptor, message: Message) = + getUnknownFields(message)[field.number.toUInt()]?.let { value -> + when { + value.varint.isNotEmpty() -> + value.varint + .map(VarintVal::value) + .map { + if (field.type == Type.UINT64) { + it + } else { + it.toLong() + } + } + + value.fixed32.isNotEmpty() -> + value.fixed32.map(Fixed32Val::value) + + value.fixed64.isNotEmpty() -> + value.fixed64.map(Fixed64Val::value) + + value.lengthDelimited.isNotEmpty() -> + value.lengthDelimited + .map(LengthDelimitedVal::value) + .map { + if (field.type == Type.STRING) { + StandardCharsets.UTF_8.decode(it.asReadOnlyBuffer()).toString() + } else { + it + } + } + + else -> error("unknown field for field number ${field.number} existed but was empty") + } + }.let { + if (field.isRepeated) { + if (field.isMapField) { + it ?: emptyMap() + } else { + it ?: emptyList() + } + } else { + it?.first() + } + } + + fun getField(message: Message, field: FieldDescriptor): Any? = + getReflectedGettersByClass(message::class)(field, message) +} + +internal fun getUnknownFields(message: Message) = + message::class + .declaredMemberProperties + .firstOrNull { it.returnType.classifier == UnknownFieldSet::class } + .let { + @Suppress("UNCHECKED_CAST") + it as KProperty1 + } + .get(message) + .unknownFields diff --git a/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/RuntimeContext.kt b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/RuntimeContext.kt new file mode 100644 index 000000000..96b5d5b97 --- /dev/null +++ b/protokt-reflect/src/jvmMain/kotlin/protokt/v1/google/protobuf/RuntimeContext.kt @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2024 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.google.protobuf + +import com.google.protobuf.Descriptors +import com.google.protobuf.Descriptors.FieldDescriptor +import com.google.protobuf.Descriptors.FieldDescriptor.Type +import com.google.protobuf.DynamicMessage +import com.google.protobuf.MapEntry +import com.google.protobuf.UnknownFieldSet +import com.google.protobuf.UnknownFieldSet.Field +import com.google.protobuf.UnsafeByteOperations +import com.google.protobuf.WireFormat +import com.toasttab.protokt.v1.ProtoktProtos +import protokt.v1.Bytes +import protokt.v1.Converter +import protokt.v1.Enum +import protokt.v1.GeneratedMessage +import protokt.v1.Message +import protokt.v1.reflect.ClassLookup +import protokt.v1.reflect.FieldType +import protokt.v1.reflect.WellKnownTypes +import protokt.v1.reflect.inferClassName +import protokt.v1.reflect.resolvePackage +import protokt.v1.reflect.typeName +import kotlin.Any +import kotlin.reflect.full.findAnnotation + +class RuntimeContext internal constructor( + descriptors: Iterable, + private val classLookup: ClassLookup +) { + constructor(descriptors: Iterable) : this(descriptors, ClassLookup(emptyList())) + + internal val descriptorsByTypeName = descriptors.associateBy { it.fullName } + + fun convertValue(value: Any) = + when (value) { + is Enum -> value.value + is UInt -> value.toInt() + is ULong -> value.toLong() + is Message -> toDynamicMessage(value, this) + is Bytes -> UnsafeByteOperations.unsafeWrap(value.asReadOnlyBuffer()) + + // pray + else -> value + } + + internal fun unwrap(value: Any, field: FieldDescriptor, wrap: String): Any { + val proto = field.toProto() + val type = FieldType.from(proto.type) + val converterDetails = + classLookup.converter( + ClassLookup.evaluateProtobufTypeCanonicalName( + proto.typeName, + typeName(proto.typeName, type), + type, + field.name + ), + wrap + ) + + @Suppress("UNCHECKED_CAST") + val converter = converterDetails.converter as Converter + return converter.unwrap(value) + } +} + +private fun toDynamicMessage( + message: Message, + context: RuntimeContext, +): com.google.protobuf.Message { + val descriptor = + context.descriptorsByTypeName + .getValue(message::class.findAnnotation()!!.fullTypeName) + + return DynamicMessage.newBuilder(descriptor) + .apply { + descriptor.fields.forEach { field -> + message.getField(field)?.let { value -> + val fieldOptions = fieldOptions(field) + + setField( + field, + when { + field.type == Type.ENUM -> + if (field.isRepeated) { + (value as List<*>).map { field.enumType.findValueByNumberCreatingIfUnknown(((it as Enum).value)) } + } else { + field.enumType.findValueByNumberCreatingIfUnknown(((value as Enum).value)) + } + + field.isMapField -> + convertMap(value, field, fieldOptions, context) + + field.isRepeated -> + convertList((value as List<*>), field, fieldOptions, context) + + else -> { + val wrap = wrap(field, fieldOptions) + if (wrap == null) { + context.convertValue(value) + } else { + context.convertValue(context.unwrap(value, field, wrap)) + } + } + }, + ) + } + } + } + .setUnknownFields(mapUnknownFields(message)) + .build() +} + +private fun fieldOptions(field: FieldDescriptor): ProtoktProtos.FieldOptions { + val options = field.toProto().options + + return if (options.hasField(ProtoktProtos.property.descriptor)) { + options.getField(ProtoktProtos.property.descriptor) as ProtoktProtos.FieldOptions + } else if (options.unknownFields.hasField(ProtoktProtos.property.number)) { + ProtoktProtos.FieldOptions.parseFrom( + options.unknownFields.getField(ProtoktProtos.property.number) + .lengthDelimitedList + .last() + ) + } else { + ProtoktProtos.FieldOptions.getDefaultInstance() + } +} + +private fun wrap(field: FieldDescriptor, fieldOptions: ProtoktProtos.FieldOptions) = + getClassName(fieldOptions.wrap, field) + +private fun getClassName(wrap: String, field: FieldDescriptor): String? = + WellKnownTypes.wrapWithWellKnownInterception(wrap.takeIf { it.isNotEmpty() }, field.toProto().typeName) + ?.let { inferClassName(it, resolvePackage(field.file.`package`)) } + ?.let { (pkg, names) -> pkg + "." + names.joinToString(".") } + +private fun convertList( + value: List<*>, + field: FieldDescriptor, + fieldOptions: ProtoktProtos.FieldOptions, + context: RuntimeContext +): List<*> { + val wrap = wrap(field, fieldOptions) + return value.map { + if (wrap == null) { + it?.let(context::convertValue) + } else { + context.convertValue(context.unwrap(it!!, field, wrap)) + } + } +} + +private fun convertMap( + value: Any, + field: FieldDescriptor, + fieldOptions: ProtoktProtos.FieldOptions, + context: RuntimeContext +): List> { + val keyDesc = field.messageType.findFieldByNumber(1) + val valDesc = field.messageType.findFieldByNumber(2) + + val keyDefault = + if (keyDesc.type == Type.MESSAGE) { + null + } else { + keyDesc.defaultValue + } + + val valDefault = + if (valDesc.type == Type.MESSAGE) { + null + } else { + valDesc.defaultValue + } + + val keyWrap = getClassName(fieldOptions.keyWrap, keyDesc) + val valWrap = getClassName(fieldOptions.valueWrap, valDesc) + + val defaultEntry = + MapEntry.newDefaultInstance( + field.messageType, + WireFormat.FieldType.valueOf(keyDesc.type.name), + keyDefault, + WireFormat.FieldType.valueOf(valDesc.type.name), + valDefault + ) as MapEntry + + return (value as Map<*, *>).map { (k, v) -> + defaultEntry.toBuilder() + .setKey( + if (keyWrap == null) { + k?.let(context::convertValue) + } else { + context.convertValue(context.unwrap(k!!, keyDesc, keyWrap)) + } + ) + .setValue( + if (valWrap == null) { + v?.let(context::convertValue) + } else { + context.convertValue(context.unwrap(v!!, valDesc, valWrap)) + } + ) + .build() + } +} + +private fun mapUnknownFields(message: Message): UnknownFieldSet { + val unknownFields = UnknownFieldSet.newBuilder() + + getUnknownFields(message).forEach { (number, field) -> + unknownFields.mergeField( + number.toInt(), + Field.newBuilder() + .apply { + field.varint.forEach { addVarint(it.value.toLong()) } + field.fixed32.forEach { addFixed32(it.value.toInt()) } + field.fixed64.forEach { addFixed64(it.value.toLong()) } + field.lengthDelimited.forEach { addLengthDelimited(UnsafeByteOperations.unsafeWrap(it.value.asReadOnlyBuffer())) } + } + .build() + ) + } + + return unknownFields.build() +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 6383ecd6a..8a8bc1c6d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -31,6 +31,7 @@ include( "protokt-codegen", "protokt-core", "protokt-core-lite", + "protokt-reflect", "protokt-runtime", "protokt-runtime-grpc", "protokt-runtime-grpc-lite", diff --git a/shared-src/gradle-plugin/protokt/v1/gradle/ProtobufBuild.kt b/shared-src/gradle-plugin/protokt/v1/gradle/ProtobufBuild.kt index 240c4d5ca..e5c8dd8ae 100644 --- a/shared-src/gradle-plugin/protokt/v1/gradle/ProtobufBuild.kt +++ b/shared-src/gradle-plugin/protokt/v1/gradle/ProtobufBuild.kt @@ -33,6 +33,7 @@ import java.net.URLEncoder internal fun configureProtobufPlugin( project: Project, ext: ProtoktExtension, + disableJava: Boolean, binaryPath: String ) { project.apply() @@ -52,8 +53,10 @@ internal fun configureProtobufPlugin( generateProtoTasks { for (task in all()) { - task.builtins { - findByName("java")?.run(::remove) + if (disableJava) { + task.builtins { + findByName("java")?.run(::remove) + } } task.plugins { diff --git a/shared-src/gradle-plugin/protokt/v1/gradle/ProtoktBuild.kt b/shared-src/gradle-plugin/protokt/v1/gradle/ProtoktBuild.kt index c80abf41b..11f032d70 100644 --- a/shared-src/gradle-plugin/protokt/v1/gradle/ProtoktBuild.kt +++ b/shared-src/gradle-plugin/protokt/v1/gradle/ProtoktBuild.kt @@ -48,10 +48,15 @@ const val EXTENSIONS = "protoktExtensions" const val TEST_EXTENSIONS = "testProtoktExtensions" -internal fun configureProtokt(project: Project, protoktVersion: Any?, resolveBinary: () -> String) { +internal fun configureProtokt( + project: Project, + protoktVersion: Any?, + disableJava: Boolean = true, + resolveBinary: () -> String +) { injectKotlinPluginsIntoProtobufGradle() val ext = project.extensions.create("protokt") - configureProtobufPlugin(project, ext, resolveBinary()) + configureProtobufPlugin(project, ext, disableJava, resolveBinary()) project.createExtensionConfigurationsAndConfigureProtobuf() diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassLookup.kt b/shared-src/reflect/protokt/v1/reflect/ClassLookup.kt similarity index 83% rename from protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassLookup.kt rename to shared-src/reflect/protokt/v1/reflect/ClassLookup.kt index 52da2b310..9a6d766a2 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/ClassLookup.kt +++ b/shared-src/reflect/protokt/v1/reflect/ClassLookup.kt @@ -13,11 +13,8 @@ * limitations under the License. */ -package protokt.v1.codegen.util +package protokt.v1.reflect -import com.google.common.collect.HashBasedTable -import com.google.common.collect.ImmutableTable -import com.google.common.collect.Table import protokt.v1.Bytes import protokt.v1.Converter import protokt.v1.OptimizedSizeOfConverter @@ -27,7 +24,7 @@ import kotlin.reflect.KClass import kotlin.reflect.full.hasAnnotation import kotlin.reflect.full.memberProperties -class ClassLookup(classpath: List) { +internal class ClassLookup(classpath: List) { private val classLoader by lazy { val current = Thread.currentThread().contextClassLoader @@ -43,7 +40,7 @@ class ClassLookup(classpath: List) { } } - private val convertersByProtoClassNameAndKotlinClassName by lazy { + private val convertersByProtoClassNameAndKotlinClassName: Map>>> by lazy { classLoader.getResources("META-INF/services/${Converter::class.qualifiedName}") .asSequence() .flatMap { url -> @@ -55,10 +52,12 @@ class ClassLookup(classpath: List) { .map { classLoader.loadClass(it).kotlin.objectInstance as Converter<*, *> } .toList() } - }.run { - val table = HashBasedTable.create>>() - forEach { table.getOrPut(it.wrapped.qualifiedName!!, it.wrapper.qualifiedName!!) { mutableListOf() }.add(it) } - ImmutableTable.builder>>().putAll(table).build() + }.fold(mutableMapOf>>>()) { acc, converter -> + acc.apply { + getOrPut(converter.wrapped.qualifiedName!!, ::mutableMapOf) + .getOrPut(converter.wrapper.qualifiedName!!, ::mutableListOf) + .add(converter) + } } } @@ -75,10 +74,9 @@ class ClassLookup(classpath: List) { fun converter(protoClassCanonicalName: String, kotlinClassCanonicalName: String): ConverterDetails { val converters = - convertersByProtoClassNameAndKotlinClassName.get( - protoClassCanonicalName, - kotlinClassCanonicalName - ) ?: emptyList() + convertersByProtoClassNameAndKotlinClassName[protoClassCanonicalName] + ?.get(kotlinClassCanonicalName) + .orEmpty() require(converters.isNotEmpty()) { "No converter found for wrapper type $kotlinClassCanonicalName from type $protoClassCanonicalName" @@ -153,12 +151,9 @@ private fun tryDeserializeDefaultValue(converter: Converter): Th return if (protoDefault == null) null else tryWrap(protoDefault as T) } -class ConverterDetails( +internal class ConverterDetails( val converter: Converter<*, *>, val kotlinCanonicalClassName: String, val optimizedSizeof: Boolean, val cannotDeserializeDefaultValue: Boolean ) - -private fun Table.getOrPut(r: R, c: C, v: () -> V): V = - get(r, c) ?: v().also { put(r, c, it) } diff --git a/shared-src/reflect/protokt/v1/reflect/ClassNames.kt b/shared-src/reflect/protokt/v1/reflect/ClassNames.kt new file mode 100644 index 000000000..9d0c5fcec --- /dev/null +++ b/shared-src/reflect/protokt/v1/reflect/ClassNames.kt @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.reflect + +internal fun inferClassName(className: String, pkg: String): Pair> { + val inferred = bestGuessPackageName(className) + return if (inferred == null) { + pkg to className.split(".") + } else { + inferred to className.substringAfter("$inferred.").split(".") + } +} + +private fun bestGuessPackageName(classNameString: String): String? { + var p = 0 + while (p < classNameString.length && Character.isLowerCase(classNameString.codePointAt(p))) { + p = classNameString.indexOf('.', p) + 1 + require(p != 0) { "couldn't make a guess for $classNameString" } + } + return if (p != 0) { + classNameString.substring(0, p - 1) + } else { + null + } +} diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldType.kt b/shared-src/reflect/protokt/v1/reflect/FieldType.kt similarity index 58% rename from protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldType.kt rename to shared-src/reflect/protokt/v1/reflect/FieldType.kt index 20cd2f222..78e55b9ed 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/util/FieldType.kt +++ b/shared-src/reflect/protokt/v1/reflect/FieldType.kt @@ -13,19 +13,13 @@ * limitations under the License. */ -package protokt.v1.codegen.util +package protokt.v1.reflect import com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type -import com.squareup.kotlinpoet.CodeBlock -import com.squareup.kotlinpoet.MemberName -import com.squareup.kotlinpoet.MemberName.Companion.member -import com.squareup.kotlinpoet.asTypeName -import protokt.v1.SizeCodecs import protokt.v1.Writer -import protokt.v1.codegen.generate.sizeOf import kotlin.reflect.KClass -sealed class FieldType { +internal sealed class FieldType { open val kotlinRepresentation: KClass<*>? = null open val inlineRepresentation: KClass<*>? = null open val ktRepresentation: KClass<*>? = null @@ -35,28 +29,28 @@ sealed class FieldType { override val ktRepresentation: KClass<*>? = null ) : FieldType() - data object Enum : Nonscalar(ktRepresentation = protokt.v1.Enum::class) - data object Message : Nonscalar(ktRepresentation = Message::class) - data object String : Nonscalar(kotlin.String::class) - data object Bytes : Nonscalar(protokt.v1.Bytes::class) + object Enum : Nonscalar(ktRepresentation = protokt.v1.Enum::class) + object Message : Nonscalar(ktRepresentation = protokt.v1.Message::class) + object String : Nonscalar(kotlin.String::class) + object Bytes : Nonscalar(protokt.v1.Bytes::class) sealed class Scalar( override val kotlinRepresentation: KClass<*>? = null ) : FieldType() - data object Bool : Scalar(Boolean::class) - data object Double : Scalar(kotlin.Double::class) - data object Float : Scalar(kotlin.Float::class) - data object Fixed32 : Scalar(UInt::class) - data object Fixed64 : Scalar(ULong::class) - data object Int32 : Scalar(Int::class) - data object Int64 : Scalar(Long::class) - data object SFixed32 : Scalar(Int::class) - data object SFixed64 : Scalar(Long::class) - data object SInt32 : Scalar(Int::class) - data object SInt64 : Scalar(Long::class) - data object UInt32 : Scalar(UInt::class) - data object UInt64 : Scalar(ULong::class) + object Bool : Scalar(Boolean::class) + object Double : Scalar(kotlin.Double::class) + object Float : Scalar(kotlin.Float::class) + object Fixed32 : Scalar(UInt::class) + object Fixed64 : Scalar(ULong::class) + object Int32 : Scalar(Int::class) + object Int64 : Scalar(Long::class) + object SFixed32 : Scalar(Int::class) + object SFixed64 : Scalar(Long::class) + object SInt32 : Scalar(Int::class) + object SInt64 : Scalar(Long::class) + object UInt32 : Scalar(UInt::class) + object UInt64 : Scalar(ULong::class) val protoktFieldType get() = when (this) { @@ -83,20 +77,6 @@ sealed class FieldType { else -> "write" } - sealed interface SizeFn - class Const(val size: Int) : SizeFn - class Method(val method: MemberName) : SizeFn - - val sizeFn: SizeFn - get() = when (this) { - Bool -> Const(1) - Double, Fixed64, SFixed64 -> Const(8) - Float, Fixed32, SFixed32 -> Const(4) - SInt32 -> Method(SizeCodecs::class.asTypeName().member(SizeCodecs::sizeOfSInt32.name)) - SInt64 -> Method(SizeCodecs::class.asTypeName().member(SizeCodecs::sizeOfSInt64.name)) - else -> Method(sizeOf) - } - val scalar get() = this is Scalar @@ -124,21 +104,6 @@ sealed class FieldType { SFixed32 -> 5 } - val defaultValue: CodeBlock - get() = when (this) { - Message -> CodeBlock.of("null") - Enum -> error("enums do not have defaults; this is bug in the code generator") - Bool -> CodeBlock.of("false") - Fixed32, UInt32 -> CodeBlock.of("0u") - Int32, SFixed32, SInt32 -> CodeBlock.of("0") - Fixed64, UInt64 -> CodeBlock.of("0uL") - Int64, SFixed64, SInt64 -> CodeBlock.of("0L") - Float -> CodeBlock.of("0.0F") - Double -> CodeBlock.of("0.0") - Bytes -> CodeBlock.of("%T.empty()", protokt.v1.Bytes::class) - String -> CodeBlock.of("\"\"") - } - companion object { fun from(type: Type) = when (type) { diff --git a/shared-src/reflect/protokt/v1/reflect/PackageNames.kt b/shared-src/reflect/protokt/v1/reflect/PackageNames.kt new file mode 100644 index 000000000..391b7afe0 --- /dev/null +++ b/shared-src/reflect/protokt/v1/reflect/PackageNames.kt @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.reflect + +import protokt.v1.Bytes + +internal val PROTOKT_V1 = Bytes::class.java.`package`.name +internal const val DOT_GOOGLE_PROTOBUF = ".google.protobuf" + +internal fun typeName(protoTypeName: String, fieldType: FieldType): String { + val fullyProtoQualified = protoTypeName.startsWith(".") + + return if (fullyProtoQualified) { + requalifyProtoType(protoTypeName) + } else { + protoTypeName.let { + it.ifEmpty { + fieldType.protoktFieldType.qualifiedName!! + } + } + } +} + +internal fun requalifyProtoType(typeName: String) = + // type name might have a `.` prefix + if (typeName.startsWith(".$PROTOKT_V1")) { + typeName.removePrefix(".") + } else { + "$PROTOKT_V1." + typeName.removePrefix(".") + } + +internal fun resolvePackage(pkg: String) = + if (pkg.startsWith(PROTOKT_V1)) { + pkg + } else { + "$PROTOKT_V1.$pkg" + } diff --git a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/WellKnownTypes.kt b/shared-src/reflect/protokt/v1/reflect/WellKnownTypes.kt similarity index 94% rename from protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/WellKnownTypes.kt rename to shared-src/reflect/protokt/v1/reflect/WellKnownTypes.kt index daeb328df..7473326d9 100644 --- a/protokt-codegen/src/main/kotlin/protokt/v1/codegen/generate/WellKnownTypes.kt +++ b/shared-src/reflect/protokt/v1/reflect/WellKnownTypes.kt @@ -13,10 +13,9 @@ * limitations under the License. */ -package protokt.v1.codegen.generate +package protokt.v1.reflect import protokt.v1.Bytes -import protokt.v1.codegen.util.DOT_GOOGLE_PROTOBUF internal object WellKnownTypes { fun wrapWithWellKnownInterception(wrap: String?, typeName: String) = diff --git a/testing/interop/build.gradle.kts b/testing/interop/build.gradle.kts index cb81e0464..036ad70f8 100644 --- a/testing/interop/build.gradle.kts +++ b/testing/interop/build.gradle.kts @@ -14,6 +14,7 @@ */ import protokt.v1.gradle.protokt +import protokt.v1.gradle.protoktExtensions plugins { id("protokt.jvm-conventions") @@ -30,11 +31,15 @@ protokt { } dependencies { - implementation(kotlin("reflect")) - implementation(project(":protokt-runtime-grpc")) - implementation(project(":testing:protobuf-java")) + protoktExtensions(project(":extensions:protokt-extensions")) + implementation(libs.grpc.stub) + implementation(project(":protokt-runtime-grpc")) + testImplementation(project(":protokt-reflect")) + testImplementation(project(":testing:protobuf-java")) + testImplementation(kotlin("reflect")) + testImplementation(libs.classgraph) testImplementation(libs.jackson) testImplementation(libs.protobuf.java) } diff --git a/testing/interop/src/main/proto/protokt/v1/testing/wrappers_dynamic.proto b/testing/interop/src/main/proto/protokt/v1/testing/wrappers_dynamic.proto new file mode 100644 index 000000000..278ea49f2 --- /dev/null +++ b/testing/interop/src/main/proto/protokt/v1/testing/wrappers_dynamic.proto @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2019 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto3"; + +package protokt.v1.testing; + +option java_package = "com.toasttab.protokt.v1.testing"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "protokt/v1/inet_socket_address.proto"; +import "protokt/v1/protokt.proto"; + +message Wrappers { + bytes uuid = 2 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + bytes ip_address = 3 [ + (.protokt.v1.property).wrap = "java.net.InetAddress" + ]; + + .protokt.v1.InetSocketAddress socket_address = 5 [ + (.protokt.v1.property).wrap = "java.net.InetSocketAddress" + ]; + + google.protobuf.Timestamp instant = 6 [ + (.protokt.v1.property).wrap = "java.time.Instant" + ]; + + google.protobuf.Duration duration = 7 [ + (.protokt.v1.property).wrap = "java.time.Duration" + ]; + + string local_date = 8 [ + (.protokt.v1.property).wrap = "java.time.LocalDate" + ]; + + google.protobuf.BytesValue nullable_uuid = 9 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + google.protobuf.StringValue nullable_local_date = 10 [ + (.protokt.v1.property).wrap = "java.time.LocalDate" + ]; + + optional bytes optional_uuid = 12 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + optional bytes optional_ip_address = 13 [ + (.protokt.v1.property).wrap = "java.net.InetAddress" + ]; + + optional string optional_local_date = 14 [ + (.protokt.v1.property).wrap = "java.time.LocalDate" + ]; + + google.protobuf.StringValue optional_string = 15; +} + +message OneofWrappers { + oneof wrapped_oneof { + option (.protokt.v1.oneof).non_null = true; + + bytes uuid_oneof = 2 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + bytes ip_address_oneof = 3 [ + (.protokt.v1.property).wrap = "java.net.InetAddress" + ]; + + .protokt.v1.InetSocketAddress socket_address_oneof = 5 [ + (.protokt.v1.property).wrap = "java.net.InetSocketAddress" + ]; + + google.protobuf.Timestamp instant_oneof = 6 [ + (.protokt.v1.property).wrap = "java.time.Instant" + ]; + + google.protobuf.Duration duration_oneof = 7 [ + (.protokt.v1.property).wrap = "java.time.Duration" + ]; + + string local_date_oneof = 8 [ + (.protokt.v1.property).wrap = "java.time.LocalDate" + ]; + + google.protobuf.BytesValue nullable_uuid_oneof = 9 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + google.protobuf.StringValue nullable_local_date_oneof = 10 [ + (.protokt.v1.property).wrap = "java.time.LocalDate" + ]; + + google.protobuf.StringValue optional_string = 11; + } +} + +message RepeatedWrappers { + repeated bytes uuids = 1 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + repeated google.protobuf.BytesValue uuids_wrapped = 2 [ + (.protokt.v1.property).wrap = "java.util.UUID" + ]; + + repeated google.protobuf.StringValue strings = 3; +} + +message MapWrappers { + map map_string_uuid = 7 [ + (.protokt.v1.property).key_wrap = "java.time.LocalDate", + (.protokt.v1.property).value_wrap = "java.util.UUID" + ]; + + map map_string_socket_address = 8 [ + (.protokt.v1.property).key_wrap = "java.time.LocalDate", + (.protokt.v1.property).value_wrap = "java.net.InetSocketAddress" + ]; + + map map_string_string_value = 9; +} diff --git a/testing/interop/src/test/kotlin/protokt/v1/testing/DynamicMessageTest.kt b/testing/interop/src/test/kotlin/protokt/v1/testing/DynamicMessageTest.kt new file mode 100644 index 000000000..38b4f19a0 --- /dev/null +++ b/testing/interop/src/test/kotlin/protokt/v1/testing/DynamicMessageTest.kt @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.testing + +import com.google.common.truth.Truth.assertThat +import org.junit.jupiter.api.Test +import protokt.v1.Message +import protokt.v1.google.protobuf.toDynamicMessage +import java.net.InetAddress +import java.net.InetSocketAddress +import java.time.Duration +import java.time.Instant +import java.time.LocalDate +import java.util.UUID + +class DynamicMessageTest { + @Test + fun `dynamic message serialization`() { + val message = getAllTypesAllSet() + + verifyMessage(message) + } + + @Test + fun `dynamic message with wrapped fields`() { + val message = + Wrappers { + uuid = UUID.randomUUID() + ipAddress = InetAddress.getByName("127.0.0.1") + socketAddress = InetSocketAddress("127.0.0.1", 2319) + instant = Instant.now() + duration = Duration.ofSeconds(623, 2319) + localDate = LocalDate.now() + nullableUuid = UUID.randomUUID() + nullableLocalDate = LocalDate.now().minusDays(1) + optionalUuid = UUID.randomUUID() + optionalIpAddress = InetAddress.getByName("127.0.0.2") + optionalLocalDate = LocalDate.now().minusDays(2) + optionalString = "foo" + } + + verifyMessage(message) + } + + @Test + fun `dynamic message with oneof fields`() { + val message1 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.UuidOneof(UUID.randomUUID()) } + + verifyMessage(message1) + + val message2 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.IpAddressOneof(InetAddress.getByName("127.0.0.1")) } + + verifyMessage(message2) + + val message3 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.SocketAddressOneof(InetSocketAddress("127.0.0.1", 2319)) } + + verifyMessage(message3) + + val message4 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.InstantOneof(Instant.now()) } + + verifyMessage(message4) + + val message5 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.DurationOneof(Duration.ofSeconds(623, 14853)) } + + verifyMessage(message5) + + val message6 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.LocalDateOneof(LocalDate.now()) } + + verifyMessage(message6) + + val message7 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.NullableUuidOneof(UUID.randomUUID()) } + + verifyMessage(message7) + + val message8 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.NullableLocalDateOneof(LocalDate.now()) } + + verifyMessage(message8) + + val message9 = + OneofWrappers { wrappedOneof = OneofWrappers.WrappedOneof.OptionalString("foo") } + + verifyMessage(message9) + } + + @Test + fun `dynamic message with repeated fields`() { + val message = + RepeatedWrappers { + uuids = listOf(UUID.randomUUID(), UUID.randomUUID()) + uuidsWrapped = listOf(UUID.randomUUID(), UUID.randomUUID()) + strings = listOf("foo") + } + + verifyMessage(message) + } + + @Test + fun `dynamic message with map fields`() { + val message = + MapWrappers { + mapStringUuid = + mapOf( + LocalDate.now() to UUID.randomUUID(), + LocalDate.now().minusDays(1) to UUID.randomUUID() + ) + + mapStringSocketAddress = + mapOf( + LocalDate.now() to InetSocketAddress("127.0.0.1", 2319), + LocalDate.now().minusDays(1) to InetSocketAddress("127.0.0.1", 2320) + ) + + mapStringStringValue = + mapOf("foo" to "bar") + } + + verifyMessage(message) + } + + private fun verifyMessage(message: Message) { + val dynamicMessage = message.toDynamicMessage(getContextReflectively()) + + assertThat(dynamicMessage.serializedSize).isEqualTo(message.messageSize()) + assertThat(dynamicMessage.toByteArray()).isEqualTo(message.serialize()) + } +} diff --git a/testing/interop/src/test/kotlin/protokt/v1/testing/ProtoktReflectTest.kt b/testing/interop/src/test/kotlin/protokt/v1/testing/ProtoktReflectTest.kt new file mode 100644 index 000000000..99cb2d458 --- /dev/null +++ b/testing/interop/src/test/kotlin/protokt/v1/testing/ProtoktReflectTest.kt @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.testing + +import com.google.common.truth.Truth.assertThat +import com.google.protobuf.Descriptors.FieldDescriptor +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.MethodSource +import proto3_unittest.UnittestProto3 +import protokt.v1.google.protobuf.getField +import protokt.v1.google.protobuf.hasField +import protokt.v1.proto3_unittest.TestAllTypes + +class ProtoktReflectTest { + private val context = getContextReflectively() + + @ParameterizedTest + @MethodSource("optionalDescriptors") + fun `hasField behavior matches for non-optional proto3 scalar fields`(field: FieldDescriptor) { + val protoktDefault = TestAllTypes {} + val javaDefault = UnittestProto3.TestAllTypes.getDefaultInstance() + + assertThat(javaDefault.hasField(field)).isFalse() + assertThat(protoktDefault.hasField(field)).isFalse() + + assertThat(protoktDefault.getField(field)?.let(context::convertValue)) + .isEqualTo(javaDefault.getField(field)) + } + + companion object { + private val descriptor = UnittestProto3.TestAllTypes.getDescriptor() + + @JvmStatic + fun optionalDescriptors() = + listOf( + descriptor.findFieldByName("optional_int32"), + descriptor.findFieldByName("optional_int64"), + descriptor.findFieldByName("optional_uint32"), + descriptor.findFieldByName("optional_uint64"), + descriptor.findFieldByName("optional_sint32"), + descriptor.findFieldByName("optional_sint64"), + descriptor.findFieldByName("optional_fixed32"), + descriptor.findFieldByName("optional_fixed64"), + descriptor.findFieldByName("optional_sfixed32"), + descriptor.findFieldByName("optional_sfixed64"), + descriptor.findFieldByName("optional_float"), + descriptor.findFieldByName("optional_double"), + descriptor.findFieldByName("optional_bool"), + descriptor.findFieldByName("optional_string"), + descriptor.findFieldByName("optional_bytes") + ) + } +} diff --git a/testing/interop/src/test/kotlin/protokt/v1/testing/RuntimeContextUtil.kt b/testing/interop/src/test/kotlin/protokt/v1/testing/RuntimeContextUtil.kt new file mode 100644 index 000000000..dff5742a0 --- /dev/null +++ b/testing/interop/src/test/kotlin/protokt/v1/testing/RuntimeContextUtil.kt @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.testing + +import com.google.protobuf.DescriptorProtos +import com.google.protobuf.Descriptors +import io.github.classgraph.ClassGraph +import protokt.v1.GeneratedFileDescriptor +import protokt.v1.google.protobuf.FileDescriptor +import protokt.v1.google.protobuf.RuntimeContext +import kotlin.reflect.KClass +import kotlin.reflect.full.declaredMemberProperties + +fun getContextReflectively() = + RuntimeContext(getDescriptors()) + +private fun getDescriptors() = + ClassGraph() + .enableAnnotationInfo() + .scan() + .use { + it.getClassesWithAnnotation(GeneratedFileDescriptor::class.java) + .map { info -> + @Suppress("UNCHECKED_CAST") + info.loadClass().kotlin as KClass + } + } + .asSequence() + .map { klassWithDescriptor -> + klassWithDescriptor + .declaredMemberProperties + .single { it.returnType.classifier == FileDescriptor::class } + .get(klassWithDescriptor.objectInstance!!) as FileDescriptor + } + .flatMap { it.toProtobufJavaDescriptor().messageTypes } + .flatMap(::collectDescriptors) + .asIterable() + +private fun collectDescriptors(descriptor: Descriptors.Descriptor): Iterable = + listOf(descriptor) + descriptor.nestedTypes.flatMap(::collectDescriptors) + +private fun FileDescriptor.toProtobufJavaDescriptor(): Descriptors.FileDescriptor = + Descriptors.FileDescriptor.buildFrom( + DescriptorProtos.FileDescriptorProto.parseFrom(proto.serialize()), + dependencies.map { it.toProtobufJavaDescriptor() }.toTypedArray(), + true + ) diff --git a/testing/interop/src/test/kotlin/protokt/v1/testing/TestUtil.kt b/testing/interop/src/test/kotlin/protokt/v1/testing/TestUtil.kt new file mode 100644 index 000000000..50e48b1aa --- /dev/null +++ b/testing/interop/src/test/kotlin/protokt/v1/testing/TestUtil.kt @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Toast, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package protokt.v1.testing + +import protokt.v1.Bytes +import protokt.v1.proto3_unittest.ForeignEnum +import protokt.v1.proto3_unittest.ForeignMessage +import protokt.v1.proto3_unittest.TestAllTypes +import protokt.v1.protobuf_unittest_import.ImportMessage +import protokt.v1.protobuf_unittest_import.PublicImportMessage + +fun getAllTypesAllSet() = + TestAllTypes { + optionalInt32 = 101 + optionalInt64 = 102 + optionalUint32 = 103u + optionalUint64 = 104u + optionalSint32 = 105 + optionalSint64 = 106 + optionalFixed32 = 107u + optionalFixed64 = 108u + optionalSfixed32 = 109 + optionalSfixed64 = 110 + optionalFloat = 111f + optionalDouble = 112.0 + optionalBool = true + optionalString = "114" + optionalBytes = Bytes.from("115".toByteArray()) + optionalNestedMessage = TestAllTypes.NestedMessage { bb = 115 } + optionalForeignMessage = ForeignMessage { c = 116 } + optionalNestedEnum = TestAllTypes.NestedEnum.FOO + optionalForeignEnum = ForeignEnum.FOREIGN_FOO + optionalStringPiece = "119" + optionalCord = "120" + optionalPublicImportMessage = PublicImportMessage { e = 121 } + optionalLazyMessage = TestAllTypes.NestedMessage { bb = 122 } + optionalUnverifiedLazyMessage = TestAllTypes.NestedMessage { bb = 123 } + + repeatedInt32 = listOf(124) + repeatedInt64 = listOf(125) + repeatedUint32 = listOf(126u) + repeatedUint64 = listOf(127u) + repeatedSint32 = listOf(128) + repeatedSint64 = listOf(129) + repeatedFixed32 = listOf(130u) + repeatedFixed64 = listOf(131u) + repeatedSfixed32 = listOf(132) + repeatedSfixed64 = listOf(133) + repeatedFloat = listOf(134f) + repeatedDouble = listOf(135.0) + repeatedBool = listOf(true) + repeatedString = listOf("136") + repeatedBytes = listOf(Bytes.from("137".toByteArray())) + repeatedNestedMessage = listOf(TestAllTypes.NestedMessage { bb = 138 }) + repeatedForeignMessage = listOf(ForeignMessage { c = 139 }) + repeatedImportMessage = listOf(ImportMessage { d = 140 }) + repeatedNestedEnum = listOf(TestAllTypes.NestedEnum.FOO) + repeatedForeignEnum = listOf(ForeignEnum.FOREIGN_FOO) + repeatedStringPiece = listOf("143") + repeatedCord = listOf("144") + repeatedLazyMessage = listOf(TestAllTypes.NestedMessage { bb = 145 }) + + oneofField = TestAllTypes.OneofField.OneofUint32(146u) + optionalLazyImportMessage = ImportMessage { d = 147 } + } diff --git a/testing/protobuf-java/build.gradle.kts b/testing/protobuf-java/build.gradle.kts index 86eefd1bb..80f624743 100644 --- a/testing/protobuf-java/build.gradle.kts +++ b/testing/protobuf-java/build.gradle.kts @@ -24,6 +24,7 @@ defaultProtoc() dependencies { compileOnly(libs.protobuf.java) + protobuf(project(":extensions:protokt-extensions")) } sourceSets { diff --git a/third-party/proto-google-common-protos-lite/build.gradle.kts b/third-party/proto-google-common-protos-lite/build.gradle.kts index 2ff51344b..8ab2bc006 100644 --- a/third-party/proto-google-common-protos-lite/build.gradle.kts +++ b/third-party/proto-google-common-protos-lite/build.gradle.kts @@ -52,3 +52,11 @@ sourceSets { } } } + +sourceSets { + test { + java { + srcDir(rootProject.file("shared-src/lite-util")) + } + } +}