diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cb0f965b50..9a70bbfe0e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ jmh = "1.37" jsr305 = "3.0.2" junit = "4.13.2" kotlin = "2.0.21" -kotlinpoet = "1.18.1" +kotlinpoet = "2.0.0" ktlint = "0.48.2" moshi = "1.15.1" okhttp = "5.0.0-alpha.14" diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/alltypes/AllTypes.kt b/wire-golden-files/src/main/kotlin/squareup/wire/alltypes/AllTypes.kt index ed5212f17d..554a771016 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/alltypes/AllTypes.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/alltypes/AllTypes.kt @@ -506,8 +506,8 @@ public class AllTypes private constructor( schemaIndex = 49, ) @JvmField - public val rep_nested_enum: List = immutableCopyOf("rep_nested_enum", - builder.rep_nested_enum) + public val rep_nested_enum: List = + immutableCopyOf("rep_nested_enum", builder.rep_nested_enum) @field:WireField( tag = 217, @@ -516,8 +516,8 @@ public class AllTypes private constructor( schemaIndex = 50, ) @JvmField - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - builder.rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", builder.rep_nested_message) @field:WireField( tag = 301, @@ -643,8 +643,8 @@ public class AllTypes private constructor( schemaIndex = 64, ) @JvmField - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - builder.pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", builder.pack_nested_enum) @field:WireField( tag = 401, @@ -781,8 +781,8 @@ public class AllTypes private constructor( schemaIndex = 81, ) @JvmField - public val map_int32_int32: Map = immutableCopyOf("map_int32_int32", - builder.map_int32_int32) + public val map_int32_int32: Map = + immutableCopyOf("map_int32_int32", builder.map_int32_int32) @field:WireField( tag = 502, @@ -791,8 +791,8 @@ public class AllTypes private constructor( schemaIndex = 82, ) @JvmField - public val map_string_string: Map = immutableCopyOf("map_string_string", - builder.map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", builder.map_string_string) @field:WireField( tag = 503, @@ -801,8 +801,8 @@ public class AllTypes private constructor( schemaIndex = 83, ) @JvmField - public val map_string_message: Map = immutableCopyOf("map_string_message", - builder.map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", builder.map_string_message) @field:WireField( tag = 504, @@ -811,8 +811,8 @@ public class AllTypes private constructor( schemaIndex = 84, ) @JvmField - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - builder.map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", builder.map_string_enum) @field:WireField( tag = 601, @@ -1155,8 +1155,8 @@ public class AllTypes private constructor( schemaIndex = 117, ) @JvmField - public val ext_rep_fixed32: List = immutableCopyOf("ext_rep_fixed32", - builder.ext_rep_fixed32) + public val ext_rep_fixed32: List = + immutableCopyOf("ext_rep_fixed32", builder.ext_rep_fixed32) /** * Extension source: squareup/wire/all_types.proto @@ -1168,8 +1168,8 @@ public class AllTypes private constructor( schemaIndex = 118, ) @JvmField - public val ext_rep_sfixed32: List = immutableCopyOf("ext_rep_sfixed32", - builder.ext_rep_sfixed32) + public val ext_rep_sfixed32: List = + immutableCopyOf("ext_rep_sfixed32", builder.ext_rep_sfixed32) /** * Extension source: squareup/wire/all_types.proto @@ -1217,8 +1217,8 @@ public class AllTypes private constructor( schemaIndex = 122, ) @JvmField - public val ext_rep_fixed64: List = immutableCopyOf("ext_rep_fixed64", - builder.ext_rep_fixed64) + public val ext_rep_fixed64: List = + immutableCopyOf("ext_rep_fixed64", builder.ext_rep_fixed64) /** * Extension source: squareup/wire/all_types.proto @@ -1230,8 +1230,8 @@ public class AllTypes private constructor( schemaIndex = 123, ) @JvmField - public val ext_rep_sfixed64: List = immutableCopyOf("ext_rep_sfixed64", - builder.ext_rep_sfixed64) + public val ext_rep_sfixed64: List = + immutableCopyOf("ext_rep_sfixed64", builder.ext_rep_sfixed64) /** * Extension source: squareup/wire/all_types.proto @@ -1267,8 +1267,8 @@ public class AllTypes private constructor( schemaIndex = 126, ) @JvmField - public val ext_rep_double: List = immutableCopyOf("ext_rep_double", - builder.ext_rep_double) + public val ext_rep_double: List = + immutableCopyOf("ext_rep_double", builder.ext_rep_double) /** * Extension source: squareup/wire/all_types.proto @@ -1280,8 +1280,8 @@ public class AllTypes private constructor( schemaIndex = 127, ) @JvmField - public val ext_rep_string: List = immutableCopyOf("ext_rep_string", - builder.ext_rep_string) + public val ext_rep_string: List = + immutableCopyOf("ext_rep_string", builder.ext_rep_string) /** * Extension source: squareup/wire/all_types.proto @@ -1293,8 +1293,8 @@ public class AllTypes private constructor( schemaIndex = 128, ) @JvmField - public val ext_rep_bytes: List = immutableCopyOf("ext_rep_bytes", - builder.ext_rep_bytes) + public val ext_rep_bytes: List = + immutableCopyOf("ext_rep_bytes", builder.ext_rep_bytes) /** * Extension source: squareup/wire/all_types.proto @@ -1306,8 +1306,8 @@ public class AllTypes private constructor( schemaIndex = 129, ) @JvmField - public val ext_rep_nested_enum: List = immutableCopyOf("ext_rep_nested_enum", - builder.ext_rep_nested_enum) + public val ext_rep_nested_enum: List = + immutableCopyOf("ext_rep_nested_enum", builder.ext_rep_nested_enum) /** * Extension source: squareup/wire/all_types.proto @@ -1319,8 +1319,8 @@ public class AllTypes private constructor( schemaIndex = 130, ) @JvmField - public val ext_rep_nested_message: List = immutableCopyOf("ext_rep_nested_message", - builder.ext_rep_nested_message) + public val ext_rep_nested_message: List = + immutableCopyOf("ext_rep_nested_message", builder.ext_rep_nested_message) /** * Extension source: squareup/wire/all_types.proto @@ -1344,8 +1344,8 @@ public class AllTypes private constructor( schemaIndex = 132, ) @JvmField - public val ext_pack_uint32: List = immutableCopyOf("ext_pack_uint32", - builder.ext_pack_uint32) + public val ext_pack_uint32: List = + immutableCopyOf("ext_pack_uint32", builder.ext_pack_uint32) /** * Extension source: squareup/wire/all_types.proto @@ -1357,8 +1357,8 @@ public class AllTypes private constructor( schemaIndex = 133, ) @JvmField - public val ext_pack_sint32: List = immutableCopyOf("ext_pack_sint32", - builder.ext_pack_sint32) + public val ext_pack_sint32: List = + immutableCopyOf("ext_pack_sint32", builder.ext_pack_sint32) /** * Extension source: squareup/wire/all_types.proto @@ -1370,8 +1370,8 @@ public class AllTypes private constructor( schemaIndex = 134, ) @JvmField - public val ext_pack_fixed32: List = immutableCopyOf("ext_pack_fixed32", - builder.ext_pack_fixed32) + public val ext_pack_fixed32: List = + immutableCopyOf("ext_pack_fixed32", builder.ext_pack_fixed32) /** * Extension source: squareup/wire/all_types.proto @@ -1383,8 +1383,8 @@ public class AllTypes private constructor( schemaIndex = 135, ) @JvmField - public val ext_pack_sfixed32: List = immutableCopyOf("ext_pack_sfixed32", - builder.ext_pack_sfixed32) + public val ext_pack_sfixed32: List = + immutableCopyOf("ext_pack_sfixed32", builder.ext_pack_sfixed32) /** * Extension source: squareup/wire/all_types.proto @@ -1408,8 +1408,8 @@ public class AllTypes private constructor( schemaIndex = 137, ) @JvmField - public val ext_pack_uint64: List = immutableCopyOf("ext_pack_uint64", - builder.ext_pack_uint64) + public val ext_pack_uint64: List = + immutableCopyOf("ext_pack_uint64", builder.ext_pack_uint64) /** * Extension source: squareup/wire/all_types.proto @@ -1421,8 +1421,8 @@ public class AllTypes private constructor( schemaIndex = 138, ) @JvmField - public val ext_pack_sint64: List = immutableCopyOf("ext_pack_sint64", - builder.ext_pack_sint64) + public val ext_pack_sint64: List = + immutableCopyOf("ext_pack_sint64", builder.ext_pack_sint64) /** * Extension source: squareup/wire/all_types.proto @@ -1434,8 +1434,8 @@ public class AllTypes private constructor( schemaIndex = 139, ) @JvmField - public val ext_pack_fixed64: List = immutableCopyOf("ext_pack_fixed64", - builder.ext_pack_fixed64) + public val ext_pack_fixed64: List = + immutableCopyOf("ext_pack_fixed64", builder.ext_pack_fixed64) /** * Extension source: squareup/wire/all_types.proto @@ -1447,8 +1447,8 @@ public class AllTypes private constructor( schemaIndex = 140, ) @JvmField - public val ext_pack_sfixed64: List = immutableCopyOf("ext_pack_sfixed64", - builder.ext_pack_sfixed64) + public val ext_pack_sfixed64: List = + immutableCopyOf("ext_pack_sfixed64", builder.ext_pack_sfixed64) /** * Extension source: squareup/wire/all_types.proto @@ -1484,8 +1484,8 @@ public class AllTypes private constructor( schemaIndex = 143, ) @JvmField - public val ext_pack_double: List = immutableCopyOf("ext_pack_double", - builder.ext_pack_double) + public val ext_pack_double: List = + immutableCopyOf("ext_pack_double", builder.ext_pack_double) /** * Extension source: squareup/wire/all_types.proto @@ -1497,8 +1497,8 @@ public class AllTypes private constructor( schemaIndex = 144, ) @JvmField - public val ext_pack_nested_enum: List = immutableCopyOf("ext_pack_nested_enum", - builder.ext_pack_nested_enum) + public val ext_pack_nested_enum: List = + immutableCopyOf("ext_pack_nested_enum", builder.ext_pack_nested_enum) override fun newBuilder(): Builder { val builder = Builder() @@ -2048,14 +2048,12 @@ public class AllTypes private constructor( if (array_uint32.isNotEmpty()) result += """array_uint32=${array_uint32.contentToString()}""" if (array_sint32.isNotEmpty()) result += """array_sint32=${array_sint32.contentToString()}""" if (array_fixed32.isNotEmpty()) result += """array_fixed32=${array_fixed32.contentToString()}""" - if (array_sfixed32.isNotEmpty()) result += - """array_sfixed32=${array_sfixed32.contentToString()}""" + if (array_sfixed32.isNotEmpty()) result += """array_sfixed32=${array_sfixed32.contentToString()}""" if (array_int64.isNotEmpty()) result += """array_int64=${array_int64.contentToString()}""" if (array_uint64.isNotEmpty()) result += """array_uint64=${array_uint64.contentToString()}""" if (array_sint64.isNotEmpty()) result += """array_sint64=${array_sint64.contentToString()}""" if (array_fixed64.isNotEmpty()) result += """array_fixed64=${array_fixed64.contentToString()}""" - if (array_sfixed64.isNotEmpty()) result += - """array_sfixed64=${array_sfixed64.contentToString()}""" + if (array_sfixed64.isNotEmpty()) result += """array_sfixed64=${array_sfixed64.contentToString()}""" if (array_float.isNotEmpty()) result += """array_float=${array_float.contentToString()}""" if (array_double.isNotEmpty()) result += """array_double=${array_double.contentToString()}""" if (ext_opt_int32 != null) result += """ext_opt_int32=$ext_opt_int32""" @@ -2074,8 +2072,7 @@ public class AllTypes private constructor( if (ext_opt_string != null) result += """ext_opt_string=${sanitize(ext_opt_string)}""" if (ext_opt_bytes != null) result += """ext_opt_bytes=$ext_opt_bytes""" if (ext_opt_nested_enum != null) result += """ext_opt_nested_enum=$ext_opt_nested_enum""" - if (ext_opt_nested_message != null) result += - """ext_opt_nested_message=$ext_opt_nested_message""" + if (ext_opt_nested_message != null) result += """ext_opt_nested_message=$ext_opt_nested_message""" if (ext_rep_int32.isNotEmpty()) result += """ext_rep_int32=$ext_rep_int32""" if (ext_rep_uint32.isNotEmpty()) result += """ext_rep_uint32=$ext_rep_uint32""" if (ext_rep_sint32.isNotEmpty()) result += """ext_rep_sint32=$ext_rep_sint32""" @@ -2092,8 +2089,7 @@ public class AllTypes private constructor( if (ext_rep_string.isNotEmpty()) result += """ext_rep_string=${sanitize(ext_rep_string)}""" if (ext_rep_bytes.isNotEmpty()) result += """ext_rep_bytes=$ext_rep_bytes""" if (ext_rep_nested_enum.isNotEmpty()) result += """ext_rep_nested_enum=$ext_rep_nested_enum""" - if (ext_rep_nested_message.isNotEmpty()) result += - """ext_rep_nested_message=$ext_rep_nested_message""" + if (ext_rep_nested_message.isNotEmpty()) result += """ext_rep_nested_message=$ext_rep_nested_message""" if (ext_pack_int32.isNotEmpty()) result += """ext_pack_int32=$ext_pack_int32""" if (ext_pack_uint32.isNotEmpty()) result += """ext_pack_uint32=$ext_pack_uint32""" if (ext_pack_sint32.isNotEmpty()) result += """ext_pack_sint32=$ext_pack_sint32""" @@ -2107,8 +2103,7 @@ public class AllTypes private constructor( if (ext_pack_bool.isNotEmpty()) result += """ext_pack_bool=$ext_pack_bool""" if (ext_pack_float.isNotEmpty()) result += """ext_pack_float=$ext_pack_float""" if (ext_pack_double.isNotEmpty()) result += """ext_pack_double=$ext_pack_double""" - if (ext_pack_nested_enum.isNotEmpty()) result += - """ext_pack_nested_enum=$ext_pack_nested_enum""" + if (ext_pack_nested_enum.isNotEmpty()) result += """ext_pack_nested_enum=$ext_pack_nested_enum""" return result.joinToString(prefix = "AllTypes{", separator = ", ", postfix = "}") } @@ -3388,17 +3383,17 @@ public class AllTypes private constructor( null, "squareup/wire/all_types.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -3532,8 +3527,7 @@ public class AllTypes private constructor( size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1_114, value.ext_rep_string) size += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(1_115, value.ext_rep_bytes) size += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(1_116, value.ext_rep_nested_enum) - size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, - value.ext_rep_nested_message) + size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, value.ext_rep_nested_message) size += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(1_201, value.ext_pack_int32) size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(1_202, value.ext_pack_uint32) size += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(1_203, value.ext_pack_sint32) @@ -3682,8 +3676,7 @@ public class AllTypes private constructor( ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) @@ -3717,8 +3710,7 @@ public class AllTypes private constructor( ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) @@ -4642,8 +4634,7 @@ public class AllTypes private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } } diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/boxedoneof/BoxedOneOfs.kt b/wire-golden-files/src/main/kotlin/squareup/wire/boxedoneof/BoxedOneOfs.kt index 33da8fdef9..85717a882d 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/boxedoneof/BoxedOneOfs.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/boxedoneof/BoxedOneOfs.kt @@ -64,8 +64,7 @@ public class BoxedOneOfs( return result.joinToString(prefix = "BoxedOneOfs{", separator = ", ", postfix = "}") } - public fun copy(value_: OneOf, *>? = this.value_, unknownFields: ByteString = - this.unknownFields): BoxedOneOfs = BoxedOneOfs(value_, unknownFields) + public fun copy(value_: OneOf, *>? = this.value_, unknownFields: ByteString = this.unknownFields): BoxedOneOfs = BoxedOneOfs(value_, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -144,18 +143,18 @@ public class BoxedOneOfs( ) } - public val VALUE_FIRST_VALUE: Value = Value(tag = 1, adapter = - ProtoAdapter.STRING, declaredName = "first_value") + public val VALUE_FIRST_VALUE: Value = + Value(tag = 1, adapter = ProtoAdapter.STRING, declaredName = "first_value") - public val VALUE_SECOND_VALUE: Value = Value(tag = 2, adapter = - ProtoAdapter.STRING, declaredName = "second_value") + public val VALUE_SECOND_VALUE: Value = + Value(tag = 2, adapter = ProtoAdapter.STRING, declaredName = "second_value") - public val VALUE_VALUE: Value = Value(tag = 3, adapter = ProtoAdapter.STRING, - declaredName = "value") + public val VALUE_VALUE: Value = + Value(tag = 3, adapter = ProtoAdapter.STRING, declaredName = "value") @JvmStatic - public val VALUE__KEYS: Set> = setOf(VALUE_FIRST_VALUE, VALUE_SECOND_VALUE, - VALUE_VALUE) + public val VALUE__KEYS: Set> = + setOf(VALUE_FIRST_VALUE, VALUE_SECOND_VALUE, VALUE_VALUE) private const val serialVersionUID: Long = 0L diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/buildersonly/SomeMessage.kt b/wire-golden-files/src/main/kotlin/squareup/wire/buildersonly/SomeMessage.kt index 76505679b2..07142be99a 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/buildersonly/SomeMessage.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/buildersonly/SomeMessage.kt @@ -243,8 +243,7 @@ public class SomeMessage private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } } diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValue.kt b/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValue.kt index 940244f4a8..61d267de84 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValue.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValue.kt @@ -48,8 +48,7 @@ public class ParameterValue( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -75,8 +74,7 @@ public class ParameterValue( return result.joinToString(prefix = "ParameterValue{", separator = ", ", postfix = "}") } - public fun copy(data_: List = this.data_, unknownFields: ByteString = this.unknownFields): - ParameterValue = ParameterValue(data_, unknownFields) + public fun copy(data_: List = this.data_, unknownFields: ByteString = this.unknownFields): ParameterValue = ParameterValue(data_, unknownFields) public companion object { @JvmField diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValueWithArray.kt b/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValueWithArray.kt index 3feeb8a6f5..868b4a24fd 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValueWithArray.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/repeateddata/ParameterValueWithArray.kt @@ -47,8 +47,7 @@ public class ParameterValueWithArray( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -74,13 +73,12 @@ public class ParameterValueWithArray( return result.joinToString(prefix = "ParameterValueWithArray{", separator = ", ", postfix = "}") } - public fun copy(data_: FloatArray = this.data_, unknownFields: ByteString = this.unknownFields): - ParameterValueWithArray = ParameterValueWithArray(data_, unknownFields) + public fun copy(data_: FloatArray = this.data_, unknownFields: ByteString = this.unknownFields): ParameterValueWithArray = ParameterValueWithArray(data_, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, ParameterValueWithArray::class, "type.googleapis.com/squareup.wire.repeateddata.ParameterValueWithArray", diff --git a/wire-golden-files/src/main/kotlin/squareup/wire/unrecognized_constant/Easter.kt b/wire-golden-files/src/main/kotlin/squareup/wire/unrecognized_constant/Easter.kt index 142c01bfb1..63b6de0832 100644 --- a/wire-golden-files/src/main/kotlin/squareup/wire/unrecognized_constant/Easter.kt +++ b/wire-golden-files/src/main/kotlin/squareup/wire/unrecognized_constant/Easter.kt @@ -63,8 +63,8 @@ public class Easter private constructor( schemaIndex = 2, ) @JvmField - public val easter_animals: List = immutableCopyOf("easter_animals", - builder.easter_animals) + public val easter_animals: List = + immutableCopyOf("easter_animals", builder.easter_animals) override fun newBuilder(): Builder { val builder = Builder() @@ -99,8 +99,7 @@ public class Easter private constructor( override fun toString(): String { val result = mutableListOf() - if (optional_easter_animal != null) result += - """optional_easter_animal=$optional_easter_animal""" + if (optional_easter_animal != null) result += """optional_easter_animal=$optional_easter_animal""" result += """identity_easter_animal=$identity_easter_animal""" if (easter_animals.isNotEmpty()) result += """easter_animals=$easter_animals""" return result.joinToString(prefix = "Easter{", separator = ", ", postfix = "}") @@ -151,8 +150,7 @@ public class Easter private constructor( override fun encodedSize(`value`: Easter): Int { var size = value.unknownFields.size size += EasterAnimal.ADAPTER.encodedSizeWithTag(2, value.optional_easter_animal) - if (value.identity_easter_animal != - squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { + if (value.identity_easter_animal != squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { size += EasterAnimal.ADAPTER.encodedSizeWithTag(3, value.identity_easter_animal) } size += EasterAnimal.ADAPTER.asRepeated().encodedSizeWithTag(4, value.easter_animals) @@ -161,8 +159,7 @@ public class Easter private constructor( override fun encode(writer: ProtoWriter, `value`: Easter) { EasterAnimal.ADAPTER.encodeWithTag(writer, 2, value.optional_easter_animal) - if (value.identity_easter_animal != - squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { + if (value.identity_easter_animal != squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { EasterAnimal.ADAPTER.encodeWithTag(writer, 3, value.identity_easter_animal) } EasterAnimal.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.easter_animals) @@ -172,8 +169,7 @@ public class Easter private constructor( override fun encode(writer: ReverseProtoWriter, `value`: Easter) { writer.writeBytes(value.unknownFields) EasterAnimal.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.easter_animals) - if (value.identity_easter_animal != - squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { + if (value.identity_easter_animal != squareup.wire.unrecognized_constant.EasterAnimal.EASTER_ANIMAL_DEFAULT) { EasterAnimal.ADAPTER.encodeWithTag(writer, 3, value.identity_easter_animal) } EasterAnimal.ADAPTER.encodeWithTag(writer, 2, value.optional_easter_animal) diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/Feature.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/Feature.kt index 95d2d88476..e2be09d518 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/Feature.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/Feature.kt @@ -59,8 +59,7 @@ public class Feature( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/FeatureDatabase.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/FeatureDatabase.kt index 8406073ffa..20c2eaa80d 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/FeatureDatabase.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/FeatureDatabase.kt @@ -50,8 +50,7 @@ public class FeatureDatabase( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -77,8 +76,7 @@ public class FeatureDatabase( return result.joinToString(prefix = "FeatureDatabase{", separator = ", ", postfix = "}") } - public fun copy(feature: List = this.feature, unknownFields: ByteString = - this.unknownFields): FeatureDatabase = FeatureDatabase(feature, unknownFields) + public fun copy(feature: List = this.feature, unknownFields: ByteString = this.unknownFields): FeatureDatabase = FeatureDatabase(feature, unknownFields) public companion object { @JvmField diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/GrpcRouteGuideClient.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/GrpcRouteGuideClient.kt index 3efb6e4bc0..a1d83daa97 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/GrpcRouteGuideClient.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/GrpcRouteGuideClient.kt @@ -41,8 +41,7 @@ public class GrpcRouteGuideClient( * repeated field), as the rectangle may cover a large area and contain a * huge number of features. */ - override fun ListFeatures(): GrpcStreamingCall = - client.newStreamingCall(GrpcMethod( + override fun ListFeatures(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( path = "/routeguide.RouteGuide/ListFeatures", requestAdapter = Rectangle.ADAPTER, responseAdapter = Feature.ADAPTER @@ -54,8 +53,7 @@ public class GrpcRouteGuideClient( * Accepts a stream of Points on a route being traversed, returning a * RouteSummary when traversal is completed. */ - override fun RecordRoute(): GrpcStreamingCall = - client.newStreamingCall(GrpcMethod( + override fun RecordRoute(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( path = "/routeguide.RouteGuide/RecordRoute", requestAdapter = Point.ADAPTER, responseAdapter = RouteSummary.ADAPTER @@ -67,8 +65,7 @@ public class GrpcRouteGuideClient( * Accepts a stream of RouteNotes sent while a route is being traversed, * while receiving other RouteNotes (e.g. from other users). */ - override fun RouteChat(): GrpcStreamingCall = - client.newStreamingCall(GrpcMethod( + override fun RouteChat(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( path = "/routeguide.RouteGuide/RouteChat", requestAdapter = RouteNote.ADAPTER, responseAdapter = RouteNote.ADAPTER diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/Point.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/Point.kt index 0c2eaa765e..32c21ad578 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/Point.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/Point.kt @@ -53,8 +53,7 @@ public class Point( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/Rectangle.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/Rectangle.kt index 5c9dd41681..7731858334 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/Rectangle.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/Rectangle.kt @@ -57,8 +57,7 @@ public class Rectangle( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteNote.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteNote.kt index 2c8cb11aff..ddebf41564 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteNote.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteNote.kt @@ -57,8 +57,7 @@ public class RouteNote( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteSummary.kt b/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteSummary.kt index 21d5c82406..b564a9cf19 100644 --- a/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteSummary.kt +++ b/wire-grpc-tests/src/test/proto-grpc/routeguide/RouteSummary.kt @@ -78,8 +78,7 @@ public class RouteSummary( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-gson-support/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt b/wire-gson-support/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt index c984572ee9..3004c6b497 100644 --- a/wire-gson-support/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt +++ b/wire-gson-support/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt @@ -79,8 +79,7 @@ public class Dinosaur( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-gson-support/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt b/wire-gson-support/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt index 241ccc0753..2f9dfd7ef7 100644 --- a/wire-gson-support/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt +++ b/wire-gson-support/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt @@ -83,8 +83,7 @@ public class Getters( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-gson-support/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt b/wire-gson-support/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt index 9c082e6665..4ddf2c7322 100644 --- a/wire-gson-support/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt +++ b/wire-gson-support/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt @@ -117,8 +117,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -171,8 +170,7 @@ public class Person( area_numbers: Map = this.area_numbers, is_canadian: Boolean? = this.is_canadian, unknownFields: ByteString = this.unknownFields, - ): Person = Person(name, id, email, phone, favorite_numbers, area_numbers, is_canadian, - unknownFields) + ): Person = Person(name, id, email, phone, favorite_numbers, area_numbers, is_canadian, unknownFields) public companion object { @JvmField @@ -184,8 +182,8 @@ public class Person( null, "person_kotlin.proto" ) { - private val area_numbersAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING) } + private val area_numbersAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING) } override fun encodedSize(`value`: Person): Int { var size = value.unknownFields.size @@ -331,8 +329,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-gson-support/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt b/wire-gson-support/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt index 7f2a48981f..3032e3f0f8 100644 --- a/wire-gson-support/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt +++ b/wire-gson-support/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt @@ -208,8 +208,8 @@ public class KeywordKotlin( null, "keyword_kotlin.proto" ) { - private val funAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val funAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } override fun encodedSize(`value`: KeywordKotlin): Int { var size = value.unknownFields.size @@ -306,8 +306,7 @@ public class KeywordKotlin( PROTO_2, KeywordKotlinEnum.object_ ) { - override fun fromValue(`value`: Int): KeywordKotlinEnum? = - KeywordKotlinEnum.fromValue(`value`) + override fun fromValue(`value`: Int): KeywordKotlinEnum? = KeywordKotlinEnum.fromValue(`value`) } @JvmStatic diff --git a/wire-gson-support/src/test/java/squareup/proto3/AllStructs.kt b/wire-gson-support/src/test/java/squareup/proto3/AllStructs.kt index 7a6df5d732..aa63673a47 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/AllStructs.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/AllStructs.kt @@ -170,8 +170,8 @@ public class AllStructs( jsonName = "repNullValue", schemaIndex = 12, ) - public val rep_null_value: List = immutableCopyOfStruct("rep_null_value", - rep_null_value) + public val rep_null_value: List = + immutableCopyOfStruct("rep_null_value", rep_null_value) @field:WireField( tag = 201, @@ -241,8 +241,7 @@ public class AllStructs( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -318,8 +317,7 @@ public class AllStructs( if (map_int32_struct.isNotEmpty()) result += """map_int32_struct=$map_int32_struct""" if (map_int32_list.isNotEmpty()) result += """map_int32_list=$map_int32_list""" if (map_int32_value_a.isNotEmpty()) result += """map_int32_value_a=$map_int32_value_a""" - if (map_int32_null_value.isNotEmpty()) result += - """map_int32_null_value=$map_int32_null_value""" + if (map_int32_null_value.isNotEmpty()) result += """map_int32_null_value=$map_int32_null_value""" return result.joinToString(prefix = "AllStructs{", separator = ", ", postfix = "}") } @@ -344,9 +342,7 @@ public class AllStructs( map_int32_value_a: Map = this.map_int32_value_a, map_int32_null_value: Map = this.map_int32_null_value, unknownFields: ByteString = this.unknownFields, - ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, - value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, - map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) + ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) public companion object { @JvmField @@ -358,17 +354,17 @@ public class AllStructs( null, "all_structs.proto" ) { - private val map_int32_structAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } + private val map_int32_structAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } - private val map_int32_listAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } + private val map_int32_listAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } - private val map_int32_value_aAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } + private val map_int32_value_aAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } - private val map_int32_null_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } + private val map_int32_null_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } override fun encodedSize(`value`: AllStructs): Int { var size = value.unknownFields.size diff --git a/wire-gson-support/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt b/wire-gson-support/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt index 0ddff1f444..d82cb933b9 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt @@ -43,8 +43,7 @@ public class BuyOneGetOnePromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -70,13 +69,12 @@ public class BuyOneGetOnePromotion( return result.joinToString(prefix = "BuyOneGetOnePromotion{", separator = ", ", postfix = "}") } - public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): - BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) + public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, BuyOneGetOnePromotion::class, "type.googleapis.com/squareup.proto3.BuyOneGetOnePromotion", diff --git a/wire-gson-support/src/test/java/squareup/proto3/FreeDrinkPromotion.kt b/wire-gson-support/src/test/java/squareup/proto3/FreeDrinkPromotion.kt index a8fa8cdda1..2a5953b661 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/FreeDrinkPromotion.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/FreeDrinkPromotion.kt @@ -45,8 +45,7 @@ public class FreeDrinkPromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -72,13 +71,12 @@ public class FreeDrinkPromotion( return result.joinToString(prefix = "FreeDrinkPromotion{", separator = ", ", postfix = "}") } - public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): - FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) + public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeDrinkPromotion::class, "type.googleapis.com/squareup.proto3.FreeDrinkPromotion", diff --git a/wire-gson-support/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt b/wire-gson-support/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt index 66bab2eb7e..95b63c4039 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt @@ -43,8 +43,7 @@ public class FreeGarlicBreadPromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -67,18 +66,15 @@ public class FreeGarlicBreadPromotion( override fun toString(): String { val result = mutableListOf() result += """is_extra_cheesey=$is_extra_cheesey""" - return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = - "}") + return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = "}") } - public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = - this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, - unknownFields) + public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeGarlicBreadPromotion::class, "type.googleapis.com/squareup.proto3.FreeGarlicBreadPromotion", diff --git a/wire-gson-support/src/test/java/squareup/proto3/Pizza.kt b/wire-gson-support/src/test/java/squareup/proto3/Pizza.kt index 34160262b7..dec06f044d 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/Pizza.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/Pizza.kt @@ -47,8 +47,7 @@ public class Pizza( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -74,8 +73,7 @@ public class Pizza( return result.joinToString(prefix = "Pizza{", separator = ", ", postfix = "}") } - public fun copy(toppings: List = this.toppings, unknownFields: ByteString = - this.unknownFields): Pizza = Pizza(toppings, unknownFields) + public fun copy(toppings: List = this.toppings, unknownFields: ByteString = this.unknownFields): Pizza = Pizza(toppings, unknownFields) public companion object { @JvmField diff --git a/wire-gson-support/src/test/java/squareup/proto3/PizzaDelivery.kt b/wire-gson-support/src/test/java/squareup/proto3/PizzaDelivery.kt index ae5a082c6a..10786e5314 100644 --- a/wire-gson-support/src/test/java/squareup/proto3/PizzaDelivery.kt +++ b/wire-gson-support/src/test/java/squareup/proto3/PizzaDelivery.kt @@ -100,8 +100,7 @@ public class PizzaDelivery( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -139,8 +138,7 @@ public class PizzaDelivery( result += """address=${sanitize(address)}""" if (pizzas.isNotEmpty()) result += """pizzas=$pizzas""" if (promotion != null) result += """promotion=$promotion""" - if (delivered_within_or_free != null) result += - """delivered_within_or_free=$delivered_within_or_free""" + if (delivered_within_or_free != null) result += """delivered_within_or_free=$delivered_within_or_free""" if (loyalty != null) result += """loyalty=$loyalty""" if (ordered_at != null) result += """ordered_at=$ordered_at""" return result.joinToString(prefix = "PizzaDelivery{", separator = ", ", postfix = "}") @@ -155,8 +153,7 @@ public class PizzaDelivery( loyalty: Map? = this.loyalty, ordered_at: Instant? = this.ordered_at, unknownFields: ByteString = this.unknownFields, - ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, - delivered_within_or_free, loyalty, ordered_at, unknownFields) + ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, delivered_within_or_free, loyalty, ordered_at, unknownFields) public companion object { @JvmField @@ -273,8 +270,7 @@ public class PizzaDelivery( override fun redact(`value`: PizzaDelivery): PizzaDelivery = value.copy( pizzas = value.pizzas.redactElements(Pizza.ADAPTER), promotion = value.promotion?.let(AnyMessage.ADAPTER::redact), - delivered_within_or_free = - value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), + delivered_within_or_free = value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), loyalty = value.loyalty?.let(ProtoAdapter.STRUCT_MAP::redact), ordered_at = value.ordered_at?.let(ProtoAdapter.INSTANT::redact), unknownFields = ByteString.EMPTY diff --git a/wire-kotlin-generator/src/test/java/com/squareup/wire/kotlin/KotlinGeneratorTest.kt b/wire-kotlin-generator/src/test/java/com/squareup/wire/kotlin/KotlinGeneratorTest.kt index 12873e7a06..f1a21cfc91 100644 --- a/wire-kotlin-generator/src/test/java/com/squareup/wire/kotlin/KotlinGeneratorTest.kt +++ b/wire-kotlin-generator/src/test/java/com/squareup/wire/kotlin/KotlinGeneratorTest.kt @@ -149,8 +149,8 @@ class KotlinGeneratorTest { assertThat(code).contains("const val DEFAULT_I: Double = 10_000_000_000.0") assertThat(code).contains("const val DEFAULT_J: Double = -0.01") assertThat(code).contains( - "public const val DEFAULT_K: Double\n" + - " = -1_230_000_000_000_000_000_000_000_000_000_000_000_000_000_000.0", + "public const val DEFAULT_K: Double =\n" + + " -1_230_000_000_000_000_000_000_000_000_000_000_000_000_000_000.0", ) assertThat(code).contains("const val DEFAULT_L: Double = 255.0") assertThat(code).contains("const val DEFAULT_M: Double = Double.POSITIVE_INFINITY") @@ -721,8 +721,7 @@ class KotlinGeneratorTest { | /** | * Records a route made up of the provided \[Point\]s. | */ - | override fun RecordRoute(): GrpcStreamingCall = - | client.newStreamingCall(GrpcMethod( + | override fun RecordRoute(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( | path = "/routeguide.RouteGuide/RecordRoute", | requestAdapter = Point.ADAPTER, | responseAdapter = RouteSummary.ADAPTER @@ -790,8 +789,7 @@ class KotlinGeneratorTest { | /** | * List the features available in the area defined by \[Rectangle\]. | */ - | override fun ListFeatures(): GrpcStreamingCall = - | client.newStreamingCall(GrpcMethod( + | override fun ListFeatures(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( | path = "/routeguide.RouteGuide/ListFeatures", | requestAdapter = Rectangle.ADAPTER, | responseAdapter = Feature.ADAPTER @@ -862,8 +860,7 @@ class KotlinGeneratorTest { /** * Chat with someone using a \[RouteNote\]. */ - override fun RouteChat(): GrpcStreamingCall = - client.newStreamingCall(GrpcMethod( + override fun RouteChat(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( path = "/routeguide.RouteGuide/RouteChat", requestAdapter = RouteNote.ADAPTER, responseAdapter = RouteNote.ADAPTER @@ -932,8 +929,7 @@ class KotlinGeneratorTest { /** * Chat with someone using a \[RouteNote\]. */ - override fun RouteChat(): GrpcStreamingCall = - client.newStreamingCall(GrpcMethod( + override fun RouteChat(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( path = "/routeguide.RouteGuide/RouteChat", requestAdapter = RouteNote.ADAPTER, responseAdapter = RouteNote.ADAPTER @@ -1072,8 +1068,7 @@ class KotlinGeneratorTest { | /** | * Chat with someone using a \[RouteNote\]. | */ - | override fun RouteChat(): GrpcStreamingCall = - | client.newStreamingCall(GrpcMethod( + | override fun RouteChat(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( | path = "/routeguide.RouteGuide/RouteChat", | requestAdapter = RouteNote.ADAPTER, | responseAdapter = RouteNote.ADAPTER @@ -1185,8 +1180,7 @@ class KotlinGeneratorTest { |public class GrpcRouteGuideRouteChatClient( | private val client: GrpcClient, |) : RouteGuideRouteChatClient { - | override fun RouteChat(): GrpcStreamingCall = - | client.newStreamingCall(GrpcMethod( + | override fun RouteChat(): GrpcStreamingCall = client.newStreamingCall(GrpcMethod( | path = "/routeguide.RouteGuide/RouteChat", | requestAdapter = RouteNote.ADAPTER, | responseAdapter = RouteNote.ADAPTER @@ -1489,16 +1483,12 @@ class KotlinGeneratorTest { ) } val code = KotlinWithProfilesGenerator(schema).generateKotlin(longType) - val expectedEqualsConditionImplementation = """ - | ($longMember - | != - | other.$longMember) - """.trimMargin() + val expectedEqualsConditionImplementation = "if ($longMember != other.$longMember) return false" assertThat(code).contains("return false") assertThat(code).contains("return $longType(") assertThat(code).contains(expectedEqualsConditionImplementation) - assertThat(code).contains("$longMember =\n") + assertThat(code).contains("$longMember = ") } @Test fun constructorForProto3() { diff --git a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt index c984572ee9..3004c6b497 100644 --- a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt +++ b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/dinosaurs/kotlin/Dinosaur.kt @@ -79,8 +79,7 @@ public class Dinosaur( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt index 241ccc0753..2f9dfd7ef7 100644 --- a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt +++ b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/kotlin/Getters.kt @@ -83,8 +83,7 @@ public class Getters( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt index 9c082e6665..4ddf2c7322 100644 --- a/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt +++ b/wire-moshi-adapter/src/test/java/com/squareup/wire/proto2/person/kotlin/Person.kt @@ -117,8 +117,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -171,8 +170,7 @@ public class Person( area_numbers: Map = this.area_numbers, is_canadian: Boolean? = this.is_canadian, unknownFields: ByteString = this.unknownFields, - ): Person = Person(name, id, email, phone, favorite_numbers, area_numbers, is_canadian, - unknownFields) + ): Person = Person(name, id, email, phone, favorite_numbers, area_numbers, is_canadian, unknownFields) public companion object { @JvmField @@ -184,8 +182,8 @@ public class Person( null, "person_kotlin.proto" ) { - private val area_numbersAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING) } + private val area_numbersAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING) } override fun encodedSize(`value`: Person): Int { var size = value.unknownFields.size @@ -331,8 +329,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-moshi-adapter/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt b/wire-moshi-adapter/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt index 7f2a48981f..3032e3f0f8 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto2/keywords/KeywordKotlin.kt @@ -208,8 +208,8 @@ public class KeywordKotlin( null, "keyword_kotlin.proto" ) { - private val funAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val funAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } override fun encodedSize(`value`: KeywordKotlin): Int { var size = value.unknownFields.size @@ -306,8 +306,7 @@ public class KeywordKotlin( PROTO_2, KeywordKotlinEnum.object_ ) { - override fun fromValue(`value`: Int): KeywordKotlinEnum? = - KeywordKotlinEnum.fromValue(`value`) + override fun fromValue(`value`: Int): KeywordKotlinEnum? = KeywordKotlinEnum.fromValue(`value`) } @JvmStatic diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/AllStructs.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/AllStructs.kt index 7a6df5d732..aa63673a47 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/AllStructs.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/AllStructs.kt @@ -170,8 +170,8 @@ public class AllStructs( jsonName = "repNullValue", schemaIndex = 12, ) - public val rep_null_value: List = immutableCopyOfStruct("rep_null_value", - rep_null_value) + public val rep_null_value: List = + immutableCopyOfStruct("rep_null_value", rep_null_value) @field:WireField( tag = 201, @@ -241,8 +241,7 @@ public class AllStructs( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -318,8 +317,7 @@ public class AllStructs( if (map_int32_struct.isNotEmpty()) result += """map_int32_struct=$map_int32_struct""" if (map_int32_list.isNotEmpty()) result += """map_int32_list=$map_int32_list""" if (map_int32_value_a.isNotEmpty()) result += """map_int32_value_a=$map_int32_value_a""" - if (map_int32_null_value.isNotEmpty()) result += - """map_int32_null_value=$map_int32_null_value""" + if (map_int32_null_value.isNotEmpty()) result += """map_int32_null_value=$map_int32_null_value""" return result.joinToString(prefix = "AllStructs{", separator = ", ", postfix = "}") } @@ -344,9 +342,7 @@ public class AllStructs( map_int32_value_a: Map = this.map_int32_value_a, map_int32_null_value: Map = this.map_int32_null_value, unknownFields: ByteString = this.unknownFields, - ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, - value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, - map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) + ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) public companion object { @JvmField @@ -358,17 +354,17 @@ public class AllStructs( null, "all_structs.proto" ) { - private val map_int32_structAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } + private val map_int32_structAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } - private val map_int32_listAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } + private val map_int32_listAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } - private val map_int32_value_aAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } + private val map_int32_value_aAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } - private val map_int32_null_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } + private val map_int32_null_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } override fun encodedSize(`value`: AllStructs): Int { var size = value.unknownFields.size diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt index 0ddff1f444..d82cb933b9 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/BuyOneGetOnePromotion.kt @@ -43,8 +43,7 @@ public class BuyOneGetOnePromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -70,13 +69,12 @@ public class BuyOneGetOnePromotion( return result.joinToString(prefix = "BuyOneGetOnePromotion{", separator = ", ", postfix = "}") } - public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): - BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) + public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, BuyOneGetOnePromotion::class, "type.googleapis.com/squareup.proto3.BuyOneGetOnePromotion", diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/FreeDrinkPromotion.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/FreeDrinkPromotion.kt index a8fa8cdda1..2a5953b661 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/FreeDrinkPromotion.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/FreeDrinkPromotion.kt @@ -45,8 +45,7 @@ public class FreeDrinkPromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -72,13 +71,12 @@ public class FreeDrinkPromotion( return result.joinToString(prefix = "FreeDrinkPromotion{", separator = ", ", postfix = "}") } - public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): - FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) + public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeDrinkPromotion::class, "type.googleapis.com/squareup.proto3.FreeDrinkPromotion", diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt index 66bab2eb7e..95b63c4039 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/FreeGarlicBreadPromotion.kt @@ -43,8 +43,7 @@ public class FreeGarlicBreadPromotion( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -67,18 +66,15 @@ public class FreeGarlicBreadPromotion( override fun toString(): String { val result = mutableListOf() result += """is_extra_cheesey=$is_extra_cheesey""" - return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = - "}") + return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = "}") } - public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = - this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, - unknownFields) + public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeGarlicBreadPromotion::class, "type.googleapis.com/squareup.proto3.FreeGarlicBreadPromotion", diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/Pizza.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/Pizza.kt index 34160262b7..dec06f044d 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/Pizza.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/Pizza.kt @@ -47,8 +47,7 @@ public class Pizza( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -74,8 +73,7 @@ public class Pizza( return result.joinToString(prefix = "Pizza{", separator = ", ", postfix = "}") } - public fun copy(toppings: List = this.toppings, unknownFields: ByteString = - this.unknownFields): Pizza = Pizza(toppings, unknownFields) + public fun copy(toppings: List = this.toppings, unknownFields: ByteString = this.unknownFields): Pizza = Pizza(toppings, unknownFields) public companion object { @JvmField diff --git a/wire-moshi-adapter/src/test/java/squareup/proto3/PizzaDelivery.kt b/wire-moshi-adapter/src/test/java/squareup/proto3/PizzaDelivery.kt index ae5a082c6a..10786e5314 100644 --- a/wire-moshi-adapter/src/test/java/squareup/proto3/PizzaDelivery.kt +++ b/wire-moshi-adapter/src/test/java/squareup/proto3/PizzaDelivery.kt @@ -100,8 +100,7 @@ public class PizzaDelivery( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -139,8 +138,7 @@ public class PizzaDelivery( result += """address=${sanitize(address)}""" if (pizzas.isNotEmpty()) result += """pizzas=$pizzas""" if (promotion != null) result += """promotion=$promotion""" - if (delivered_within_or_free != null) result += - """delivered_within_or_free=$delivered_within_or_free""" + if (delivered_within_or_free != null) result += """delivered_within_or_free=$delivered_within_or_free""" if (loyalty != null) result += """loyalty=$loyalty""" if (ordered_at != null) result += """ordered_at=$ordered_at""" return result.joinToString(prefix = "PizzaDelivery{", separator = ", ", postfix = "}") @@ -155,8 +153,7 @@ public class PizzaDelivery( loyalty: Map? = this.loyalty, ordered_at: Instant? = this.ordered_at, unknownFields: ByteString = this.unknownFields, - ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, - delivered_within_or_free, loyalty, ordered_at, unknownFields) + ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, delivered_within_or_free, loyalty, ordered_at, unknownFields) public companion object { @JvmField @@ -273,8 +270,7 @@ public class PizzaDelivery( override fun redact(`value`: PizzaDelivery): PizzaDelivery = value.copy( pizzas = value.pizzas.redactElements(Pizza.ADAPTER), promotion = value.promotion?.let(AnyMessage.ADAPTER::redact), - delivered_within_or_free = - value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), + delivered_within_or_free = value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), loyalty = value.loyalty?.let(ProtoAdapter.STRUCT_MAP::redact), ordered_at = value.ordered_at?.let(ProtoAdapter.INSTANT::redact), unknownFields = ByteString.EMPTY diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/dinosaurs/Dinosaur.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/dinosaurs/Dinosaur.kt index 7e31efb889..0467c6a92c 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/dinosaurs/Dinosaur.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/dinosaurs/Dinosaur.kt @@ -79,8 +79,7 @@ public class Dinosaur( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/all_types/AllTypes.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/all_types/AllTypes.kt index 439094fe9a..b02b95fde4 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/all_types/AllTypes.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/all_types/AllTypes.kt @@ -622,8 +622,8 @@ public class AllTypes( jsonName = "repNestedMessage", schemaIndex = 56, ) - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 218, @@ -659,8 +659,8 @@ public class AllTypes( jsonName = "repListValue", schemaIndex = 60, ) - public val rep_list_value: List?> = immutableCopyOfStruct("rep_list_value", - rep_list_value) + public val rep_list_value: List?> = + immutableCopyOfStruct("rep_list_value", rep_list_value) @field:WireField( tag = 222, @@ -678,8 +678,8 @@ public class AllTypes( jsonName = "repNullValue", schemaIndex = 62, ) - public val rep_null_value: List = immutableCopyOfStruct("rep_null_value", - rep_null_value) + public val rep_null_value: List = + immutableCopyOfStruct("rep_null_value", rep_null_value) @field:WireField( tag = 224, @@ -823,8 +823,8 @@ public class AllTypes( jsonName = "packNestedEnum", schemaIndex = 78, ) - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 323, @@ -833,8 +833,8 @@ public class AllTypes( jsonName = "packNullValue", schemaIndex = 79, ) - public val pack_null_value: List = immutableCopyOfStruct("pack_null_value", - pack_null_value) + public val pack_null_value: List = + immutableCopyOfStruct("pack_null_value", pack_null_value) @field:WireField( tag = 501, @@ -852,8 +852,8 @@ public class AllTypes( jsonName = "mapStringString", schemaIndex = 81, ) - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -862,8 +862,8 @@ public class AllTypes( jsonName = "mapStringMessage", schemaIndex = 82, ) - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -872,8 +872,8 @@ public class AllTypes( jsonName = "mapStringEnum", schemaIndex = 83, ) - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) @field:WireField( tag = 518, @@ -891,8 +891,8 @@ public class AllTypes( jsonName = "mapInt32Duration", schemaIndex = 85, ) - public val map_int32_duration: Map = immutableCopyOf("map_int32_duration", - map_int32_duration) + public val map_int32_duration: Map = + immutableCopyOf("map_int32_duration", map_int32_duration) @field:WireField( tag = 520, @@ -921,8 +921,8 @@ public class AllTypes( jsonName = "mapInt32Value", schemaIndex = 88, ) - public val map_int32_value: Map = immutableCopyOfMapWithStructValues("map_int32_value", - map_int32_value) + public val map_int32_value: Map = + immutableCopyOfMapWithStructValues("map_int32_value", map_int32_value) @field:WireField( tag = 523, @@ -950,8 +950,8 @@ public class AllTypes( jsonName = "mapInt32Timestamp", schemaIndex = 91, ) - public val map_int32_timestamp: Map = immutableCopyOf("map_int32_timestamp", - map_int32_timestamp) + public val map_int32_timestamp: Map = + immutableCopyOf("map_int32_timestamp", map_int32_timestamp) @field:WireField( tag = 620, @@ -969,12 +969,11 @@ public class AllTypes( oneofName = "choice", schemaIndex = 98, ) - public val oneof_list_value: List<*>? = immutableCopyOfStruct("oneof_list_value", - oneof_list_value) + public val oneof_list_value: List<*>? = + immutableCopyOfStruct("oneof_list_value", oneof_list_value) init { - require(countNonNull(oneof_string, oneof_int32, oneof_nested_message, oneof_any, oneof_duration, - oneof_struct, oneof_list_value, oneof_empty, oneof_timestamp) <= 1) { + require(countNonNull(oneof_string, oneof_int32, oneof_nested_message, oneof_any, oneof_duration, oneof_struct, oneof_list_value, oneof_empty, oneof_timestamp) <= 1) { "At most one of oneof_string, oneof_int32, oneof_nested_message, oneof_any, oneof_duration, oneof_struct, oneof_list_value, oneof_empty, oneof_timestamp may be non-null" } } @@ -983,8 +982,7 @@ public class AllTypes( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -1293,11 +1291,9 @@ public class AllTypes( if (map_int32_any.isNotEmpty()) result += """map_int32_any=$map_int32_any""" if (map_int32_duration.isNotEmpty()) result += """map_int32_duration=$map_int32_duration""" if (map_int32_struct.isNotEmpty()) result += """map_int32_struct=$map_int32_struct""" - if (map_int32_list_value.isNotEmpty()) result += - """map_int32_list_value=$map_int32_list_value""" + if (map_int32_list_value.isNotEmpty()) result += """map_int32_list_value=$map_int32_list_value""" if (map_int32_value.isNotEmpty()) result += """map_int32_value=$map_int32_value""" - if (map_int32_null_value.isNotEmpty()) result += - """map_int32_null_value=$map_int32_null_value""" + if (map_int32_null_value.isNotEmpty()) result += """map_int32_null_value=$map_int32_null_value""" if (map_int32_empty.isNotEmpty()) result += """map_int32_empty=$map_int32_empty""" if (map_int32_timestamp.isNotEmpty()) result += """map_int32_timestamp=$map_int32_timestamp""" if (oneof_string != null) result += """oneof_string=${sanitize(oneof_string)}""" @@ -1415,24 +1411,7 @@ public class AllTypes( oneof_empty: Unit? = this.oneof_empty, oneof_timestamp: Instant? = this.oneof_timestamp, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(proto3_kotlin_int32, proto3_kotlin_uint32, proto3_kotlin_sint32, - proto3_kotlin_fixed32, proto3_kotlin_sfixed32, proto3_kotlin_int64, proto3_kotlin_uint64, - proto3_kotlin_sint64, proto3_kotlin_fixed64, proto3_kotlin_sfixed64, proto3_kotlin_bool, - proto3_kotlin_float, proto3_kotlin_double, proto3_kotlin_string, proto3_kotlin_bytes, - nested_enum, nested_message, any, duration, struct, list_value, value_, null_value, empty, - timestamp, opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, - opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, - opt_string, opt_bytes, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, - rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, - rep_string, rep_bytes, rep_nested_enum, rep_nested_message, rep_any, rep_duration, rep_struct, - rep_list_value, rep_value, rep_null_value, rep_empty, rep_timestamp, pack_int32, pack_uint32, - pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, - pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, pack_null_value, - map_int32_int32, map_string_string, map_string_message, map_string_enum, map_int32_any, - map_int32_duration, map_int32_struct, map_int32_list_value, map_int32_value, - map_int32_null_value, map_int32_empty, map_int32_timestamp, oneof_string, oneof_int32, - oneof_nested_message, oneof_any, oneof_duration, oneof_struct, oneof_list_value, oneof_empty, - oneof_timestamp, unknownFields) + ): AllTypes = AllTypes(proto3_kotlin_int32, proto3_kotlin_uint32, proto3_kotlin_sint32, proto3_kotlin_fixed32, proto3_kotlin_sfixed32, proto3_kotlin_int64, proto3_kotlin_uint64, proto3_kotlin_sint64, proto3_kotlin_fixed64, proto3_kotlin_sfixed64, proto3_kotlin_bool, proto3_kotlin_float, proto3_kotlin_double, proto3_kotlin_string, proto3_kotlin_bytes, nested_enum, nested_message, any, duration, struct, list_value, value_, null_value, empty, timestamp, opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, rep_any, rep_duration, rep_struct, rep_list_value, rep_value, rep_null_value, rep_empty, rep_timestamp, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, pack_null_value, map_int32_int32, map_string_string, map_string_message, map_string_enum, map_int32_any, map_int32_duration, map_int32_struct, map_int32_list_value, map_int32_value, map_int32_null_value, map_int32_empty, map_int32_timestamp, oneof_string, oneof_int32, oneof_nested_message, oneof_any, oneof_duration, oneof_struct, oneof_list_value, oneof_empty, oneof_timestamp, unknownFields) public companion object { @JvmField @@ -1444,41 +1423,41 @@ public class AllTypes( null, "all_types.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } - private val map_int32_anyAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, AnyMessage.ADAPTER) } + private val map_int32_anyAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, AnyMessage.ADAPTER) } - private val map_int32_durationAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.DURATION) } + private val map_int32_durationAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.DURATION) } - private val map_int32_structAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } + private val map_int32_structAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } - private val map_int32_list_valueAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } + private val map_int32_list_valueAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } - private val map_int32_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } + private val map_int32_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } - private val map_int32_null_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } + private val map_int32_null_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } - private val map_int32_emptyAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.EMPTY) } + private val map_int32_emptyAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.EMPTY) } - private val map_int32_timestampAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INSTANT) } + private val map_int32_timestampAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INSTANT) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -1527,8 +1506,7 @@ public class AllTypes( if (value.proto3_kotlin_bytes != okio.ByteString.EMPTY) { size += ProtoAdapter.BYTES.encodedSizeWithTag(15, value.proto3_kotlin_bytes) } - if (value.nested_enum != - com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { + if (value.nested_enum != com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { size += NestedEnum.ADAPTER.encodedSizeWithTag(16, value.nested_enum) } if (value.nested_message != null) { @@ -1683,8 +1661,7 @@ public class AllTypes( if (value.proto3_kotlin_bytes != okio.ByteString.EMPTY) { ProtoAdapter.BYTES.encodeWithTag(writer, 15, value.proto3_kotlin_bytes) } - if (value.nested_enum != - com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { + if (value.nested_enum != com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { NestedEnum.ADAPTER.encodeWithTag(writer, 16, value.nested_enum) } if (value.nested_message != null) { @@ -1898,8 +1875,7 @@ public class AllTypes( if (value.nested_message != null) { NestedMessage.ADAPTER.encodeWithTag(writer, 17, value.nested_message) } - if (value.nested_enum != - com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { + if (value.nested_enum != com.squareup.wire.proto3.kotlin.all_types.AllTypes.NestedEnum.UNKNOWN) { NestedEnum.ADAPTER.encodeWithTag(writer, 16, value.nested_enum) } if (value.proto3_kotlin_bytes != okio.ByteString.EMPTY) { @@ -2483,8 +2459,7 @@ public class AllTypes( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -2510,8 +2485,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/person/Person.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/person/Person.kt index 8e95f792d1..d89a5b3f3a 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/person/Person.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/proto3/kotlin/person/Person.kt @@ -117,8 +117,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -337,8 +336,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt index 59491dc1a8..4b23b1b37c 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt @@ -145,8 +145,7 @@ public class FooBar( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -339,8 +338,7 @@ public class FooBar( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -366,8 +364,7 @@ public class FooBar( return result.joinToString(prefix = "Nested{", separator = ", ", postfix = "}") } - public fun copy(value_: FooBarBazEnum? = this.value_, unknownFields: ByteString = - this.unknownFields): Nested = Nested(value_, unknownFields) + public fun copy(value_: FooBarBazEnum? = this.value_, unknownFields: ByteString = this.unknownFields): Nested = Nested(value_, unknownFields) public companion object { @JvmField @@ -438,8 +435,7 @@ public class FooBar( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -465,8 +461,7 @@ public class FooBar( return result.joinToString(prefix = "More{", separator = ", ", postfix = "}") } - public fun copy(serial: List = this.serial, unknownFields: ByteString = - this.unknownFields): More = More(serial, unknownFields) + public fun copy(serial: List = this.serial, unknownFields: ByteString = this.unknownFields): More = More(serial, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt index d32ab9fbe0..8b0e27f843 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt @@ -47,8 +47,7 @@ public class MessageWithOptions( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -61,13 +60,12 @@ public class MessageWithOptions( override fun toString(): String = "MessageWithOptions{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithOptions = - MessageWithOptions(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithOptions = MessageWithOptions(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, MessageWithOptions::class, "type.googleapis.com/squareup.protos.custom_options.MessageWithOptions", diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/BoxedOneOfs.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/BoxedOneOfs.kt index ca1fde1481..db0d4b8dd7 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/BoxedOneOfs.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/BoxedOneOfs.kt @@ -39,8 +39,7 @@ public class BoxedOneOfs( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -66,8 +65,7 @@ public class BoxedOneOfs( return result.joinToString(prefix = "BoxedOneOfs{", separator = ", ", postfix = "}") } - public fun copy(OneOf: OneOf, *>? = this.OneOf, unknownFields: ByteString = - this.unknownFields): BoxedOneOfs = BoxedOneOfs(OneOf, unknownFields) + public fun copy(OneOf: OneOf, *>? = this.OneOf, unknownFields: ByteString = this.unknownFields): BoxedOneOfs = BoxedOneOfs(OneOf, unknownFields) public class OneOf_( tag: Int, @@ -131,39 +129,39 @@ public class BoxedOneOfs( ) } - public val ONEOF_ARRAY: OneOf_ = OneOf_(tag = 1, adapter = ProtoAdapter.STRING, - declaredName = "array") + public val ONEOF_ARRAY: OneOf_ = + OneOf_(tag = 1, adapter = ProtoAdapter.STRING, declaredName = "array") - public val ONEOF_BOOLEAN: OneOf_ = OneOf_(tag = 2, adapter = - ProtoAdapter.STRING, declaredName = "boolean") + public val ONEOF_BOOLEAN: OneOf_ = + OneOf_(tag = 2, adapter = ProtoAdapter.STRING, declaredName = "boolean") - public val ONEOF_CLASS: OneOf_ = OneOf_(tag = 3, adapter = ProtoAdapter.STRING, - declaredName = "class") + public val ONEOF_CLASS: OneOf_ = + OneOf_(tag = 3, adapter = ProtoAdapter.STRING, declaredName = "class") - public val ONEOF_OPEN: OneOf_ = OneOf_(tag = 4, adapter = ProtoAdapter.STRING, - declaredName = "open") + public val ONEOF_OPEN: OneOf_ = + OneOf_(tag = 4, adapter = ProtoAdapter.STRING, declaredName = "open") - public val ONEOF_FUN: OneOf_ = OneOf_(tag = 5, adapter = ProtoAdapter.STRING, - declaredName = "fun") + public val ONEOF_FUN: OneOf_ = + OneOf_(tag = 5, adapter = ProtoAdapter.STRING, declaredName = "fun") - public val ONEOF_VAL: OneOf_ = OneOf_(tag = 6, adapter = ProtoAdapter.STRING, - declaredName = "val") + public val ONEOF_VAL: OneOf_ = + OneOf_(tag = 6, adapter = ProtoAdapter.STRING, declaredName = "val") - public val ONEOF_PRIVATE: OneOf_ = OneOf_(tag = 7, adapter = - ProtoAdapter.STRING, declaredName = "private") + public val ONEOF_PRIVATE: OneOf_ = + OneOf_(tag = 7, adapter = ProtoAdapter.STRING, declaredName = "private") - public val ONEOF_RETURN: OneOf_ = OneOf_(tag = 8, adapter = ProtoAdapter.STRING, - declaredName = "return") + public val ONEOF_RETURN: OneOf_ = + OneOf_(tag = 8, adapter = ProtoAdapter.STRING, declaredName = "return") - public val ONEOF_RESULT: OneOf_ = OneOf_(tag = 9, adapter = ProtoAdapter.STRING, - declaredName = "result") + public val ONEOF_RESULT: OneOf_ = + OneOf_(tag = 9, adapter = ProtoAdapter.STRING, declaredName = "result") - public val ONEOF_PUBLIC: OneOf_ = OneOf_(tag = 10, adapter = - ProtoAdapter.STRING, declaredName = "public") + public val ONEOF_PUBLIC: OneOf_ = + OneOf_(tag = 10, adapter = ProtoAdapter.STRING, declaredName = "public") @JvmStatic - public val ONEOF_KEYS: Set> = setOf(ONEOF_ARRAY, ONEOF_BOOLEAN, ONEOF_CLASS, - ONEOF_OPEN, ONEOF_FUN, ONEOF_VAL, ONEOF_PRIVATE, ONEOF_RETURN, ONEOF_RESULT, ONEOF_PUBLIC) + public val ONEOF_KEYS: Set> = + setOf(ONEOF_ARRAY, ONEOF_BOOLEAN, ONEOF_CLASS, ONEOF_OPEN, ONEOF_FUN, ONEOF_VAL, ONEOF_PRIVATE, ONEOF_RETURN, ONEOF_RESULT, ONEOF_PUBLIC) private const val serialVersionUID: Long = 0L } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt index 9edb18bc0f..3809c4048f 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt @@ -43,8 +43,7 @@ public class DeprecatedProto( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -70,8 +69,7 @@ public class DeprecatedProto( return result.joinToString(prefix = "DeprecatedProto{", separator = ", ", postfix = "}") } - public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): - DeprecatedProto = DeprecatedProto(foo, unknownFields) + public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): DeprecatedProto = DeprecatedProto(foo, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt index 8917ff76bc..9d3ca41ff5 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt @@ -42,8 +42,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -162,81 +161,74 @@ public class Form( ) } - public val CHOICE_BUTTON_ELEMENT: Choice = Choice(tag = 1, adapter - = ButtonElement.ADAPTER, declaredName = "button_element") + public val CHOICE_BUTTON_ELEMENT: Choice = + Choice(tag = 1, adapter = ButtonElement.ADAPTER, declaredName = "button_element") - public val CHOICE_LOCAL_IMAGE_ELEMENT: Choice = Choice(tag - = 2, adapter = LocalImageElement.ADAPTER, declaredName = "local_image_element") + public val CHOICE_LOCAL_IMAGE_ELEMENT: Choice = + Choice(tag = 2, adapter = LocalImageElement.ADAPTER, declaredName = "local_image_element") public val CHOICE_REMOTE_IMAGE_ELEMENT: Choice = - Choice(tag = 3, adapter = RemoteImageElement.ADAPTER, declaredName = - "remote_image_element") + Choice(tag = 3, adapter = RemoteImageElement.ADAPTER, declaredName = "remote_image_element") - public val CHOICE_MONEY_ELEMENT: Choice = Choice(tag = 4, adapter = - MoneyElement.ADAPTER, declaredName = "money_element") + public val CHOICE_MONEY_ELEMENT: Choice = + Choice(tag = 4, adapter = MoneyElement.ADAPTER, declaredName = "money_element") - public val CHOICE_SPACER_ELEMENT: Choice = Choice(tag = 5, adapter - = SpacerElement.ADAPTER, declaredName = "spacer_element") + public val CHOICE_SPACER_ELEMENT: Choice = + Choice(tag = 5, adapter = SpacerElement.ADAPTER, declaredName = "spacer_element") - public val CHOICE_TEXT_ELEMENT: Choice = Choice(tag = 6, adapter = - TextElement.ADAPTER, declaredName = "text_element") + public val CHOICE_TEXT_ELEMENT: Choice = + Choice(tag = 6, adapter = TextElement.ADAPTER, declaredName = "text_element") public val CHOICE_CUSTOMIZED_CARD_ELEMENT: Choice = - Choice(tag = 7, adapter = CustomizedCardElement.ADAPTER, declaredName - = "customized_card_element") + Choice(tag = 7, adapter = CustomizedCardElement.ADAPTER, declaredName = "customized_card_element") - public val CHOICE_ADDRESS_ELEMENT: Choice = Choice(tag = 8, - adapter = AddressElement.ADAPTER, declaredName = "address_element") + public val CHOICE_ADDRESS_ELEMENT: Choice = + Choice(tag = 8, adapter = AddressElement.ADAPTER, declaredName = "address_element") - public val CHOICE_TEXT_INPUT_ELEMENT: Choice = Choice(tag = - 9, adapter = TextInputElement.ADAPTER, declaredName = "text_input_element") + public val CHOICE_TEXT_INPUT_ELEMENT: Choice = + Choice(tag = 9, adapter = TextInputElement.ADAPTER, declaredName = "text_input_element") @Deprecated(message = "option_picker_element is deprecated") public val CHOICE_OPTION_PICKER_ELEMENT: Choice = - Choice(tag = 10, adapter = OptionPickerElement.ADAPTER, declaredName = - "option_picker_element") + Choice(tag = 10, adapter = OptionPickerElement.ADAPTER, declaredName = "option_picker_element") - public val CHOICE_DETAIL_ROW_ELEMENT: Choice = Choice(tag = - 11, adapter = DetailRowElement.ADAPTER, declaredName = "detail_row_element") + public val CHOICE_DETAIL_ROW_ELEMENT: Choice = + Choice(tag = 11, adapter = DetailRowElement.ADAPTER, declaredName = "detail_row_element") public val CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT: Choice = - Choice(tag = 12, adapter = - CurrencyConversionFlagsElement.ADAPTER, declaredName = "currency_conversion_flags_element") + Choice(tag = 12, adapter = CurrencyConversionFlagsElement.ADAPTER, declaredName = "currency_conversion_flags_element") @JvmStatic - public val CHOICE_KEYS: Set> = setOf(CHOICE_BUTTON_ELEMENT, - CHOICE_LOCAL_IMAGE_ELEMENT, CHOICE_REMOTE_IMAGE_ELEMENT, CHOICE_MONEY_ELEMENT, - CHOICE_SPACER_ELEMENT, CHOICE_TEXT_ELEMENT, CHOICE_CUSTOMIZED_CARD_ELEMENT, - CHOICE_ADDRESS_ELEMENT, CHOICE_TEXT_INPUT_ELEMENT, CHOICE_OPTION_PICKER_ELEMENT, - CHOICE_DETAIL_ROW_ELEMENT, CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT) + public val CHOICE_KEYS: Set> = + setOf(CHOICE_BUTTON_ELEMENT, CHOICE_LOCAL_IMAGE_ELEMENT, CHOICE_REMOTE_IMAGE_ELEMENT, CHOICE_MONEY_ELEMENT, CHOICE_SPACER_ELEMENT, CHOICE_TEXT_ELEMENT, CHOICE_CUSTOMIZED_CARD_ELEMENT, CHOICE_ADDRESS_ELEMENT, CHOICE_TEXT_INPUT_ELEMENT, CHOICE_OPTION_PICKER_ELEMENT, CHOICE_DETAIL_ROW_ELEMENT, CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT) - public val DECISION_A: Decision = Decision(tag = 101, adapter = - ProtoAdapter.STRING, declaredName = "a") + public val DECISION_A: Decision = + Decision(tag = 101, adapter = ProtoAdapter.STRING, declaredName = "a") - public val DECISION_B: Decision = Decision(tag = 102, adapter = - ProtoAdapter.STRING, declaredName = "b") + public val DECISION_B: Decision = + Decision(tag = 102, adapter = ProtoAdapter.STRING, declaredName = "b") - public val DECISION_C: Decision = Decision(tag = 103, adapter = - ProtoAdapter.STRING, declaredName = "c") + public val DECISION_C: Decision = + Decision(tag = 103, adapter = ProtoAdapter.STRING, declaredName = "c") - public val DECISION_D: Decision = Decision(tag = 104, adapter = - ProtoAdapter.STRING, declaredName = "d") + public val DECISION_D: Decision = + Decision(tag = 104, adapter = ProtoAdapter.STRING, declaredName = "d") - public val DECISION_E: Decision = Decision(tag = 105, adapter = - ProtoAdapter.STRING, declaredName = "e") + public val DECISION_E: Decision = + Decision(tag = 105, adapter = ProtoAdapter.STRING, declaredName = "e") - public val DECISION_F: Decision = Decision(tag = 106, adapter = - ProtoAdapter.STRING, declaredName = "f") + public val DECISION_F: Decision = + Decision(tag = 106, adapter = ProtoAdapter.STRING, declaredName = "f") - public val DECISION_G: Decision = Decision(tag = 107, adapter = - ProtoAdapter.STRING, declaredName = "g") + public val DECISION_G: Decision = + Decision(tag = 107, adapter = ProtoAdapter.STRING, declaredName = "g") - public val DECISION_H: Decision = Decision(tag = 108, adapter = - ProtoAdapter.STRING, declaredName = "h") + public val DECISION_H: Decision = + Decision(tag = 108, adapter = ProtoAdapter.STRING, declaredName = "h") @JvmStatic - public val DECISION_KEYS: Set> = setOf(DECISION_A, DECISION_B, DECISION_C, - DECISION_D, DECISION_E, DECISION_F, DECISION_G, DECISION_H) + public val DECISION_KEYS: Set> = + setOf(DECISION_A, DECISION_B, DECISION_C, DECISION_D, DECISION_E, DECISION_F, DECISION_G, DECISION_H) private const val serialVersionUID: Long = 0L } @@ -248,8 +240,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -262,8 +253,7 @@ public class Form( override fun toString(): String = "ButtonElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): ButtonElement = - ButtonElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): ButtonElement = ButtonElement(unknownFields) public companion object { @JvmField @@ -311,8 +301,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -325,13 +314,12 @@ public class Form( override fun toString(): String = "LocalImageElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): LocalImageElement = - LocalImageElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): LocalImageElement = LocalImageElement(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, LocalImageElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.LocalImageElement", @@ -375,8 +363,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -389,13 +376,12 @@ public class Form( override fun toString(): String = "RemoteImageElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): RemoteImageElement = - RemoteImageElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): RemoteImageElement = RemoteImageElement(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, RemoteImageElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.RemoteImageElement", @@ -439,8 +425,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -453,8 +438,7 @@ public class Form( override fun toString(): String = "MoneyElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MoneyElement = - MoneyElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MoneyElement = MoneyElement(unknownFields) public companion object { @JvmField @@ -502,8 +486,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -516,8 +499,7 @@ public class Form( override fun toString(): String = "SpacerElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): SpacerElement = - SpacerElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): SpacerElement = SpacerElement(unknownFields) public companion object { @JvmField @@ -571,8 +553,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -598,8 +579,7 @@ public class Form( return result.joinToString(prefix = "TextElement{", separator = ", ", postfix = "}") } - public fun copy(text: String? = this.text, unknownFields: ByteString = this.unknownFields): - TextElement = TextElement(text, unknownFields) + public fun copy(text: String? = this.text, unknownFields: ByteString = this.unknownFields): TextElement = TextElement(text, unknownFields) public companion object { @JvmField @@ -657,8 +637,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -671,13 +650,12 @@ public class Form( override fun toString(): String = "CustomizedCardElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): CustomizedCardElement = - CustomizedCardElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): CustomizedCardElement = CustomizedCardElement(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, CustomizedCardElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.CustomizedCardElement", @@ -721,8 +699,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -735,8 +712,7 @@ public class Form( override fun toString(): String = "AddressElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): AddressElement = - AddressElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): AddressElement = AddressElement(unknownFields) public companion object { @JvmField @@ -784,8 +760,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -798,8 +773,7 @@ public class Form( override fun toString(): String = "TextInputElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): TextInputElement = - TextInputElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): TextInputElement = TextInputElement(unknownFields) public companion object { @JvmField @@ -847,8 +821,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -861,13 +834,12 @@ public class Form( override fun toString(): String = "OptionPickerElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): OptionPickerElement = - OptionPickerElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): OptionPickerElement = OptionPickerElement(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, OptionPickerElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.OptionPickerElement", @@ -911,8 +883,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -925,8 +896,7 @@ public class Form( override fun toString(): String = "DetailRowElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): DetailRowElement = - DetailRowElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): DetailRowElement = DetailRowElement(unknownFields) public companion object { @JvmField @@ -974,8 +944,7 @@ public class Form( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -988,13 +957,12 @@ public class Form( override fun toString(): String = "CurrencyConversionFlagsElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): CurrencyConversionFlagsElement - = CurrencyConversionFlagsElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): CurrencyConversionFlagsElement = CurrencyConversionFlagsElement(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, CurrencyConversionFlagsElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.CurrencyConversionFlagsElement", @@ -1022,8 +990,7 @@ public class Form( ) } - override fun redact(`value`: CurrencyConversionFlagsElement): CurrencyConversionFlagsElement - = value.copy( + override fun redact(`value`: CurrencyConversionFlagsElement): CurrencyConversionFlagsElement = value.copy( unknownFields = ByteString.EMPTY ) } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt index ec3fbe50e2..aecd2c3571 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt @@ -50,8 +50,7 @@ public class MessageUsingMultipleEnums( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -77,8 +76,7 @@ public class MessageUsingMultipleEnums( val result = mutableListOf() if (a != null) result += """a=$a""" if (b != null) result += """b=$b""" - return result.joinToString(prefix = "MessageUsingMultipleEnums{", separator = ", ", postfix = - "}") + return result.joinToString(prefix = "MessageUsingMultipleEnums{", separator = ", ", postfix = "}") } public fun copy( @@ -89,8 +87,8 @@ public class MessageUsingMultipleEnums( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, MessageUsingMultipleEnums::class, "type.googleapis.com/squareup.protos.kotlin.MessageUsingMultipleEnums", @@ -142,8 +140,7 @@ public class MessageUsingMultipleEnums( ) } - override fun redact(`value`: MessageUsingMultipleEnums): MessageUsingMultipleEnums = - value.copy( + override fun redact(`value`: MessageUsingMultipleEnums): MessageUsingMultipleEnums = value.copy( unknownFields = ByteString.EMPTY ) } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt index 09f5b77ab7..1dff9d8319 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt @@ -37,8 +37,7 @@ public class MessageWithStatus( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -51,8 +50,7 @@ public class MessageWithStatus( override fun toString(): String = "MessageWithStatus{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithStatus = - MessageWithStatus(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithStatus = MessageWithStatus(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueEnum.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueEnum.kt index 97eaa9a987..99be04bcf7 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueEnum.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueEnum.kt @@ -29,8 +29,7 @@ public enum class NegativeValueEnum( PROTO_2, null ) { - override fun fromValue(`value`: Int): NegativeValueEnum? = - NegativeValueEnum.fromValue(`value`) + override fun fromValue(`value`: Int): NegativeValueEnum? = NegativeValueEnum.fromValue(`value`) } @JvmStatic diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueMessage.kt index 9a3998f8d9..24823cedfc 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NegativeValueMessage.kt @@ -42,8 +42,7 @@ public class NegativeValueMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -69,13 +68,12 @@ public class NegativeValueMessage( return result.joinToString(prefix = "NegativeValueMessage{", separator = ", ", postfix = "}") } - public fun copy(value_: NegativeValueEnum? = this.value_, unknownFields: ByteString = - this.unknownFields): NegativeValueMessage = NegativeValueMessage(value_, unknownFields) + public fun copy(value_: NegativeValueEnum? = this.value_, unknownFields: ByteString = this.unknownFields): NegativeValueMessage = NegativeValueMessage(value_, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, NegativeValueMessage::class, "type.googleapis.com/squareup.protos.kotlin.NegativeValueMessage", diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt index 1221f82d7a..4a4260ce2f 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt @@ -35,8 +35,7 @@ public class NoFields( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -49,8 +48,7 @@ public class NoFields( override fun toString(): String = "NoFields{}" - public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = - NoFields(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = NoFields(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OneOfMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OneOfMessage.kt index 860bcf61d5..335bf38ba2 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OneOfMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OneOfMessage.kt @@ -76,8 +76,7 @@ public class OneOfMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OptionalEnumUser.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OptionalEnumUser.kt index 913bcce7de..53b28a4a16 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OptionalEnumUser.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OptionalEnumUser.kt @@ -44,8 +44,7 @@ public class OptionalEnumUser( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -71,8 +70,7 @@ public class OptionalEnumUser( return result.joinToString(prefix = "OptionalEnumUser{", separator = ", ", postfix = "}") } - public fun copy(optional_enum: OptionalEnum? = this.optional_enum, unknownFields: ByteString = - this.unknownFields): OptionalEnumUser = OptionalEnumUser(optional_enum, unknownFields) + public fun copy(optional_enum: OptionalEnum? = this.optional_enum, unknownFields: ByteString = this.unknownFields): OptionalEnumUser = OptionalEnumUser(optional_enum, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt index 39fe78155a..00c57b6fb3 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt @@ -37,8 +37,7 @@ public class OtherMessageWithStatus( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -51,13 +50,12 @@ public class OtherMessageWithStatus( override fun toString(): String = "OtherMessageWithStatus{}" - public fun copy(unknownFields: ByteString = this.unknownFields): OtherMessageWithStatus = - OtherMessageWithStatus(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): OtherMessageWithStatus = OtherMessageWithStatus(unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, OtherMessageWithStatus::class, "type.googleapis.com/squareup.protos.kotlin.OtherMessageWithStatus", diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/VeryLongProtoNameCausingBrokenLineBreaks.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/VeryLongProtoNameCausingBrokenLineBreaks.kt index a710c6150e..8b17dc2f59 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/VeryLongProtoNameCausingBrokenLineBreaks.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/VeryLongProtoNameCausingBrokenLineBreaks.kt @@ -45,8 +45,7 @@ public class VeryLongProtoNameCausingBrokenLineBreaks( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -69,18 +68,15 @@ public class VeryLongProtoNameCausingBrokenLineBreaks( override fun toString(): String { val result = mutableListOf() if (foo != null) result += """foo=${sanitize(foo)}""" - return result.joinToString(prefix = "VeryLongProtoNameCausingBrokenLineBreaks{", separator = - ", ", postfix = "}") + return result.joinToString(prefix = "VeryLongProtoNameCausingBrokenLineBreaks{", separator = ", ", postfix = "}") } - public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): - VeryLongProtoNameCausingBrokenLineBreaks = VeryLongProtoNameCausingBrokenLineBreaks(foo, - unknownFields) + public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): VeryLongProtoNameCausingBrokenLineBreaks = VeryLongProtoNameCausingBrokenLineBreaks(foo, unknownFields) public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, VeryLongProtoNameCausingBrokenLineBreaks::class, "type.googleapis.com/squareup.protos.tostring.VeryLongProtoNameCausingBrokenLineBreaks", @@ -99,8 +95,7 @@ public class VeryLongProtoNameCausingBrokenLineBreaks( writer.writeBytes(value.unknownFields) } - override fun encode(writer: ReverseProtoWriter, - `value`: VeryLongProtoNameCausingBrokenLineBreaks) { + override fun encode(writer: ReverseProtoWriter, `value`: VeryLongProtoNameCausingBrokenLineBreaks) { writer.writeBytes(value.unknownFields) ProtoAdapter.STRING.encodeWithTag(writer, 1, value.foo) } @@ -119,8 +114,7 @@ public class VeryLongProtoNameCausingBrokenLineBreaks( ) } - override fun redact(`value`: VeryLongProtoNameCausingBrokenLineBreaks): - VeryLongProtoNameCausingBrokenLineBreaks = value.copy( + override fun redact(`value`: VeryLongProtoNameCausingBrokenLineBreaks): VeryLongProtoNameCausingBrokenLineBreaks = value.copy( unknownFields = ByteString.EMPTY ) } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt index c9688684bb..e373d46bf7 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt @@ -830,8 +830,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 50, ) - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 301, @@ -943,8 +943,8 @@ public class AllTypes( label = WireField.Label.PACKED, schemaIndex = 64, ) - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 501, @@ -960,8 +960,8 @@ public class AllTypes( adapter = "com.squareup.wire.ProtoAdapter#STRING", schemaIndex = 82, ) - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -969,8 +969,8 @@ public class AllTypes( adapter = "com.squareup.wire.protos.kotlin.alltypes.AllTypes${'$'}NestedMessage#ADAPTER", schemaIndex = 83, ) - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -978,8 +978,8 @@ public class AllTypes( adapter = "com.squareup.wire.protos.kotlin.alltypes.AllTypes${'$'}NestedEnum#ADAPTER", schemaIndex = 84, ) - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) /** * Extension source: all_types.proto @@ -1155,8 +1155,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 129, ) - public val ext_rep_nested_enum: List = immutableCopyOf("ext_rep_nested_enum", - ext_rep_nested_enum) + public val ext_rep_nested_enum: List = + immutableCopyOf("ext_rep_nested_enum", ext_rep_nested_enum) /** * Extension source: all_types.proto @@ -1167,8 +1167,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 130, ) - public val ext_rep_nested_message: List = immutableCopyOf("ext_rep_nested_message", - ext_rep_nested_message) + public val ext_rep_nested_message: List = + immutableCopyOf("ext_rep_nested_message", ext_rep_nested_message) /** * Extension source: all_types.proto @@ -1322,15 +1322,14 @@ public class AllTypes( label = WireField.Label.PACKED, schemaIndex = 144, ) - public val ext_pack_nested_enum: List = immutableCopyOf("ext_pack_nested_enum", - ext_pack_nested_enum) + public val ext_pack_nested_enum: List = + immutableCopyOf("ext_pack_nested_enum", ext_pack_nested_enum) @Deprecated( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -1729,14 +1728,12 @@ public class AllTypes( if (array_uint32.isNotEmpty()) result += """array_uint32=${array_uint32.contentToString()}""" if (array_sint32.isNotEmpty()) result += """array_sint32=${array_sint32.contentToString()}""" if (array_fixed32.isNotEmpty()) result += """array_fixed32=${array_fixed32.contentToString()}""" - if (array_sfixed32.isNotEmpty()) result += - """array_sfixed32=${array_sfixed32.contentToString()}""" + if (array_sfixed32.isNotEmpty()) result += """array_sfixed32=${array_sfixed32.contentToString()}""" if (array_int64.isNotEmpty()) result += """array_int64=${array_int64.contentToString()}""" if (array_uint64.isNotEmpty()) result += """array_uint64=${array_uint64.contentToString()}""" if (array_sint64.isNotEmpty()) result += """array_sint64=${array_sint64.contentToString()}""" if (array_fixed64.isNotEmpty()) result += """array_fixed64=${array_fixed64.contentToString()}""" - if (array_sfixed64.isNotEmpty()) result += - """array_sfixed64=${array_sfixed64.contentToString()}""" + if (array_sfixed64.isNotEmpty()) result += """array_sfixed64=${array_sfixed64.contentToString()}""" if (array_float.isNotEmpty()) result += """array_float=${array_float.contentToString()}""" if (array_double.isNotEmpty()) result += """array_double=${array_double.contentToString()}""" if (ext_opt_int32 != null) result += """ext_opt_int32=$ext_opt_int32""" @@ -1755,8 +1752,7 @@ public class AllTypes( if (ext_opt_string != null) result += """ext_opt_string=${sanitize(ext_opt_string)}""" if (ext_opt_bytes != null) result += """ext_opt_bytes=$ext_opt_bytes""" if (ext_opt_nested_enum != null) result += """ext_opt_nested_enum=$ext_opt_nested_enum""" - if (ext_opt_nested_message != null) result += - """ext_opt_nested_message=$ext_opt_nested_message""" + if (ext_opt_nested_message != null) result += """ext_opt_nested_message=$ext_opt_nested_message""" if (ext_rep_int32.isNotEmpty()) result += """ext_rep_int32=$ext_rep_int32""" if (ext_rep_uint32.isNotEmpty()) result += """ext_rep_uint32=$ext_rep_uint32""" if (ext_rep_sint32.isNotEmpty()) result += """ext_rep_sint32=$ext_rep_sint32""" @@ -1773,8 +1769,7 @@ public class AllTypes( if (ext_rep_string.isNotEmpty()) result += """ext_rep_string=${sanitize(ext_rep_string)}""" if (ext_rep_bytes.isNotEmpty()) result += """ext_rep_bytes=$ext_rep_bytes""" if (ext_rep_nested_enum.isNotEmpty()) result += """ext_rep_nested_enum=$ext_rep_nested_enum""" - if (ext_rep_nested_message.isNotEmpty()) result += - """ext_rep_nested_message=$ext_rep_nested_message""" + if (ext_rep_nested_message.isNotEmpty()) result += """ext_rep_nested_message=$ext_rep_nested_message""" if (ext_pack_int32.isNotEmpty()) result += """ext_pack_int32=$ext_pack_int32""" if (ext_pack_uint32.isNotEmpty()) result += """ext_pack_uint32=$ext_pack_uint32""" if (ext_pack_sint32.isNotEmpty()) result += """ext_pack_sint32=$ext_pack_sint32""" @@ -1788,8 +1783,7 @@ public class AllTypes( if (ext_pack_bool.isNotEmpty()) result += """ext_pack_bool=$ext_pack_bool""" if (ext_pack_float.isNotEmpty()) result += """ext_pack_float=$ext_pack_float""" if (ext_pack_double.isNotEmpty()) result += """ext_pack_double=$ext_pack_double""" - if (ext_pack_nested_enum.isNotEmpty()) result += - """ext_pack_nested_enum=$ext_pack_nested_enum""" + if (ext_pack_nested_enum.isNotEmpty()) result += """ext_pack_nested_enum=$ext_pack_nested_enum""" return result.joinToString(prefix = "AllTypes{", separator = ", ", postfix = "}") } @@ -1940,31 +1934,7 @@ public class AllTypes( ext_pack_double: List = this.ext_pack_double, ext_pack_nested_enum: List = this.ext_pack_nested_enum, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, - opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, - opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, - req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, - req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, - rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, - rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, - rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, - pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, - pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, - default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, - default_fixed64, default_sfixed64, default_bool, default_float, default_double, - default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, - map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, - array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, - array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, - ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, - ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, - ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, - ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, - ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, - ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, - ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, - ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, - ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) + ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, default_fixed64, default_sfixed64, default_bool, default_float, default_double, default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) public companion object { public const val DEFAULT_DEFAULT_INT32: Int = Int.MAX_VALUE @@ -2013,17 +1983,17 @@ public class AllTypes( null, "all_types.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -2157,8 +2127,7 @@ public class AllTypes( size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1_114, value.ext_rep_string) size += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(1_115, value.ext_rep_bytes) size += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(1_116, value.ext_rep_nested_enum) - size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, - value.ext_rep_nested_message) + size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, value.ext_rep_nested_message) size += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(1_201, value.ext_pack_int32) size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(1_202, value.ext_pack_uint32) size += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(1_203, value.ext_pack_sint32) @@ -2307,8 +2276,7 @@ public class AllTypes( ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) @@ -2342,8 +2310,7 @@ public class AllTypes( ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) @@ -3131,10 +3098,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -3303,8 +3268,7 @@ public class AllTypes( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -3330,8 +3294,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/bool/TrueBoolean.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/bool/TrueBoolean.kt index ba8034fb82..c4fdb7d160 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/bool/TrueBoolean.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/bool/TrueBoolean.kt @@ -41,8 +41,7 @@ public class TrueBoolean( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class TrueBoolean( return result.joinToString(prefix = "TrueBoolean{", separator = ", ", postfix = "}") } - public fun copy(isTrue: Boolean? = this.isTrue, unknownFields: ByteString = this.unknownFields): - TrueBoolean = TrueBoolean(isTrue, unknownFields) + public fun copy(isTrue: Boolean? = this.isTrue, unknownFields: ByteString = this.unknownFields): TrueBoolean = TrueBoolean(isTrue, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/NoFields.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/NoFields.kt index 505af7f668..32c71d79cd 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/NoFields.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/NoFields.kt @@ -34,8 +34,7 @@ public class NoFields( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -48,8 +47,7 @@ public class NoFields( override fun toString(): String = "NoFields{}" - public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = - NoFields(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = NoFields(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneBytesField.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneBytesField.kt index abd53aa9df..277ce5516c 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneBytesField.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneBytesField.kt @@ -41,8 +41,7 @@ public class OneBytesField( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class OneBytesField( return result.joinToString(prefix = "OneBytesField{", separator = ", ", postfix = "}") } - public fun copy(opt_bytes: ByteString? = this.opt_bytes, unknownFields: ByteString = - this.unknownFields): OneBytesField = OneBytesField(opt_bytes, unknownFields) + public fun copy(opt_bytes: ByteString? = this.opt_bytes, unknownFields: ByteString = this.unknownFields): OneBytesField = OneBytesField(opt_bytes, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneField.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneField.kt index b518f0ce49..30b20af1f1 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneField.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/OneField.kt @@ -41,8 +41,7 @@ public class OneField( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class OneField( return result.joinToString(prefix = "OneField{", separator = ", ", postfix = "}") } - public fun copy(opt_int32: Int? = this.opt_int32, unknownFields: ByteString = this.unknownFields): - OneField = OneField(opt_int32, unknownFields) + public fun copy(opt_int32: Int? = this.opt_int32, unknownFields: ByteString = this.unknownFields): OneField = OneField(opt_int32, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/Recursive.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/Recursive.kt index b12de2e43e..795f40dbc8 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/Recursive.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/edgecases/Recursive.kt @@ -48,8 +48,7 @@ public class Recursive( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt index 86912140a9..1ae0cded36 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt @@ -50,8 +50,7 @@ public class ForeignMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt index 8d98d53178..ae0a03af43 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt @@ -48,8 +48,7 @@ public class Mappy( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -75,8 +74,7 @@ public class Mappy( return result.joinToString(prefix = "Mappy{", separator = ", ", postfix = "}") } - public fun copy(things: Map = this.things, unknownFields: ByteString = - this.unknownFields): Mappy = Mappy(things, unknownFields) + public fun copy(things: Map = this.things, unknownFields: ByteString = this.unknownFields): Mappy = Mappy(things, unknownFields) public companion object { @JvmField @@ -88,8 +86,8 @@ public class Mappy( null, "map.proto" ) { - private val thingsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, Thing.ADAPTER) } + private val thingsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, Thing.ADAPTER) } override fun encodedSize(`value`: Mappy): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt index b85ef11379..ac1c83e82f 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt @@ -78,8 +78,7 @@ public class MappyTwo( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -132,17 +131,17 @@ public class MappyTwo( null, "map.proto" ) { - private val string_enumsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ValueEnum.ADAPTER) } + private val string_enumsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ValueEnum.ADAPTER) } - private val int_thingsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, Thing.ADAPTER) } + private val int_thingsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, Thing.ADAPTER) } - private val string_intsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.SINT64) } + private val string_intsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.SINT64) } - private val int_things_twoAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, Thing.ADAPTER) } + private val int_things_twoAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, Thing.ADAPTER) } override fun encodedSize(`value`: MappyTwo): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt index 49ecd72609..0c8b1615ff 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt @@ -42,8 +42,7 @@ public class Thing( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -69,8 +68,7 @@ public class Thing( return result.joinToString(prefix = "Thing{", separator = ", ", postfix = "}") } - public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing - = Thing(name, unknownFields) + public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing = Thing(name, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt index ee2cb8ffc0..0f0432a7e4 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt @@ -96,8 +96,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -277,8 +276,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/NotRedacted.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/NotRedacted.kt index eb1c7a7c7f..083d5f8ed3 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/NotRedacted.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/NotRedacted.kt @@ -48,8 +48,7 @@ public class NotRedacted( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedChild.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedChild.kt index b668ec9260..36fbeab3bd 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedChild.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedChild.kt @@ -54,8 +54,7 @@ public class RedactedChild( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleA.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleA.kt index 27c49873c4..bf49ee977e 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleA.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleA.kt @@ -41,8 +41,7 @@ public class RedactedCycleA( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class RedactedCycleA( return result.joinToString(prefix = "RedactedCycleA{", separator = ", ", postfix = "}") } - public fun copy(b: RedactedCycleB? = this.b, unknownFields: ByteString = this.unknownFields): - RedactedCycleA = RedactedCycleA(b, unknownFields) + public fun copy(b: RedactedCycleB? = this.b, unknownFields: ByteString = this.unknownFields): RedactedCycleA = RedactedCycleA(b, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleB.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleB.kt index bced24b417..38724112f4 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleB.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedCycleB.kt @@ -41,8 +41,7 @@ public class RedactedCycleB( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class RedactedCycleB( return result.joinToString(prefix = "RedactedCycleB{", separator = ", ", postfix = "}") } - public fun copy(a: RedactedCycleA? = this.a, unknownFields: ByteString = this.unknownFields): - RedactedCycleB = RedactedCycleB(a, unknownFields) + public fun copy(a: RedactedCycleA? = this.a, unknownFields: ByteString = this.unknownFields): RedactedCycleB = RedactedCycleB(a, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedExtension.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedExtension.kt index a2b765b52c..5de3dfea33 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedExtension.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedExtension.kt @@ -49,8 +49,7 @@ public class RedactedExtension( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedFields.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedFields.kt index 538ea97f2b..5c5dc441ec 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedFields.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedFields.kt @@ -64,8 +64,7 @@ public class RedactedFields( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedOneOf.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedOneOf.kt index 7887b4988e..3998f145bf 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedOneOf.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedOneOf.kt @@ -57,8 +57,7 @@ public class RedactedOneOf( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRepeated.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRepeated.kt index f053c6620f..4aca2c1127 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRepeated.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRepeated.kt @@ -60,8 +60,7 @@ public class RedactedRepeated( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRequired.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRequired.kt index bb507fab40..b3dc37820c 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRequired.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/RedactedRequired.kt @@ -45,8 +45,7 @@ public class RedactedRequired( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -72,8 +71,7 @@ public class RedactedRequired( return result.joinToString(prefix = "RedactedRequired{", separator = ", ", postfix = "}") } - public fun copy(a: String = this.a, unknownFields: ByteString = this.unknownFields): - RedactedRequired = RedactedRequired(a, unknownFields) + public fun copy(a: String = this.a, unknownFields: ByteString = this.unknownFields): RedactedRequired = RedactedRequired(a, unknownFields) public companion object { @JvmField @@ -115,8 +113,7 @@ public class RedactedRequired( ) } - override fun redact(`value`: RedactedRequired): RedactedRequired = throw - UnsupportedOperationException("Field 'a' is required and cannot be redacted.") + override fun redact(`value`: RedactedRequired): RedactedRequired = throw UnsupportedOperationException("Field 'a' is required and cannot be redacted.") } private const val serialVersionUID: Long = 0L diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleA.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleA.kt index 2b9b0fd1fe..c35a94c950 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleA.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleA.kt @@ -134,7 +134,6 @@ public class RedactedCycleA private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedCycleA = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedCycleA = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleB.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleB.kt index ac572362ff..cefec8654c 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleB.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedCycleB.kt @@ -134,7 +134,6 @@ public class RedactedCycleB private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedCycleB = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedCycleB = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedExtension.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedExtension.kt index 841cc3bbfc..3e1ded8850 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedExtension.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedExtension.kt @@ -160,7 +160,6 @@ public class RedactedExtension private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedExtension = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedExtension = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedFields.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedFields.kt index 9a06b7feca..f1dc608aff 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedFields.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedFields.kt @@ -212,7 +212,6 @@ public class RedactedFields private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedFields = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedFields = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRepeated.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRepeated.kt index e7796786ca..892b0bb784 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRepeated.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRepeated.kt @@ -178,7 +178,6 @@ public class RedactedRepeated private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedRepeated = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedRepeated = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRequired.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRequired.kt index a9756a8cbd..205b333707 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRequired.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/redacted/buildersonly/RedactedRequired.kt @@ -127,14 +127,12 @@ public class RedactedRequired private constructor( ) } - override fun redact(`value`: RedactedRequired): RedactedRequired = throw - UnsupportedOperationException("Field 'a' is required and cannot be redacted.") + override fun redact(`value`: RedactedRequired): RedactedRequired = throw UnsupportedOperationException("Field 'a' is required and cannot be redacted.") } private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RedactedRequired = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RedactedRequired = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt index 41c9942514..dd9abceb53 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt @@ -92,8 +92,7 @@ public class ExternalMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -142,8 +141,7 @@ public class ExternalMessage( nested_message_ext: SimpleMessage.NestedMessage? = this.nested_message_ext, nested_enum_ext: SimpleMessage.NestedEnum? = this.nested_enum_ext, unknownFields: ByteString = this.unknownFields, - ): ExternalMessage = ExternalMessage(f, fooext, barext, bazext, nested_message_ext, - nested_enum_ext, unknownFields) + ): ExternalMessage = ExternalMessage(f, fooext, barext, bazext, nested_message_ext, nested_enum_ext, unknownFields) public companion object { public const val DEFAULT_F: Float = 20f @@ -163,8 +161,7 @@ public class ExternalMessage( size += ProtoAdapter.INT32.asRepeated().encodedSizeWithTag(125, value.fooext) size += ProtoAdapter.INT32.encodedSizeWithTag(126, value.barext) size += ProtoAdapter.INT32.encodedSizeWithTag(127, value.bazext) - size += SimpleMessage.NestedMessage.ADAPTER.encodedSizeWithTag(128, - value.nested_message_ext) + size += SimpleMessage.NestedMessage.ADAPTER.encodedSizeWithTag(128, value.nested_message_ext) size += SimpleMessage.NestedEnum.ADAPTER.encodedSizeWithTag(129, value.nested_enum_ext) return size } @@ -223,8 +220,7 @@ public class ExternalMessage( } override fun redact(`value`: ExternalMessage): ExternalMessage = value.copy( - nested_message_ext = - value.nested_message_ext?.let(SimpleMessage.NestedMessage.ADAPTER::redact), + nested_message_ext = value.nested_message_ext?.let(SimpleMessage.NestedMessage.ADAPTER::redact), unknownFields = ByteString.EMPTY ) } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt index 0632d3ec47..2fc8687aa1 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt @@ -159,8 +159,7 @@ public class SimpleMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other_: Any?): Boolean { if (other_ === this) return true @@ -211,8 +210,7 @@ public class SimpleMessage( result_ += """required_int32=$required_int32""" if (repeated_double.isNotEmpty()) result_ += """repeated_double=$repeated_double""" if (default_foreign_enum != null) result_ += """default_foreign_enum=$default_foreign_enum""" - if (no_default_foreign_enum != null) result_ += - """no_default_foreign_enum=$no_default_foreign_enum""" + if (no_default_foreign_enum != null) result_ += """no_default_foreign_enum=$no_default_foreign_enum""" if (package_ != null) result_ += """package_=${sanitize(package_)}""" if (result != null) result_ += """result=${sanitize(result)}""" if (other != null) result_ += """other=${sanitize(other)}""" @@ -234,9 +232,7 @@ public class SimpleMessage( other: String? = this.other, o: String? = this.o, unknownFields: ByteString = this.unknownFields, - ): SimpleMessage = SimpleMessage(optional_int32, optional_nested_msg, optional_external_msg, - default_nested_enum, required_int32, repeated_double, default_foreign_enum, - no_default_foreign_enum, package_, result, other, o, unknownFields) + ): SimpleMessage = SimpleMessage(optional_int32, optional_nested_msg, optional_external_msg, default_nested_enum, required_int32, repeated_double, default_foreign_enum, no_default_foreign_enum, package_, result, other, o, unknownFields) public companion object { public const val DEFAULT_OPTIONAL_INT32: Int = 123 @@ -354,8 +350,7 @@ public class SimpleMessage( optional_nested_msg = optional_nested_msg, optional_external_msg = optional_external_msg, default_nested_enum = default_nested_enum, - required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, - "required_int32"), + required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, "required_int32"), repeated_double = repeated_double, default_foreign_enum = default_foreign_enum, no_default_foreign_enum = no_default_foreign_enum, @@ -393,8 +388,7 @@ public class SimpleMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -420,8 +414,7 @@ public class SimpleMessage( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(bb: Int? = this.bb, unknownFields: ByteString = this.unknownFields): - NestedMessage = NestedMessage(bb, unknownFields) + public fun copy(bb: Int? = this.bb, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(bb, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/buildersonly/SimpleMessage.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/buildersonly/SimpleMessage.kt index 8d05328b6e..1110554b6f 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/buildersonly/SimpleMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/buildersonly/SimpleMessage.kt @@ -61,8 +61,7 @@ public class SimpleMessage private constructor( @Deprecated(message = "optional_nested_msg is deprecated") @field:WireField( tag = 2, - adapter = - "com.squareup.wire.protos.kotlin.simple.buildersonly.SimpleMessage${'$'}NestedMessage#ADAPTER", + adapter = "com.squareup.wire.protos.kotlin.simple.buildersonly.SimpleMessage${'$'}NestedMessage#ADAPTER", schemaIndex = 1, ) @JvmField @@ -81,8 +80,7 @@ public class SimpleMessage private constructor( @field:WireField( tag = 4, - adapter = - "com.squareup.wire.protos.kotlin.simple.buildersonly.SimpleMessage${'$'}NestedEnum#ADAPTER", + adapter = "com.squareup.wire.protos.kotlin.simple.buildersonly.SimpleMessage${'$'}NestedEnum#ADAPTER", schemaIndex = 3, ) @JvmField @@ -111,8 +109,8 @@ public class SimpleMessage private constructor( schemaIndex = 5, ) @JvmField - public val repeated_double: List = immutableCopyOf("repeated_double", - builder.repeated_double) + public val repeated_double: List = + immutableCopyOf("repeated_double", builder.repeated_double) /** * enum from another package with an explicit default @@ -248,8 +246,7 @@ public class SimpleMessage private constructor( result_ += """required_int32=$required_int32""" if (repeated_double.isNotEmpty()) result_ += """repeated_double=$repeated_double""" if (default_foreign_enum != null) result_ += """default_foreign_enum=$default_foreign_enum""" - if (no_default_foreign_enum != null) result_ += - """no_default_foreign_enum=$no_default_foreign_enum""" + if (no_default_foreign_enum != null) result_ += """no_default_foreign_enum=$no_default_foreign_enum""" if (package_ != null) result_ += """package_=${sanitize(package_)}""" if (result != null) result_ += """result=${sanitize(result)}""" if (other != null) result_ += """other=${sanitize(other)}""" @@ -631,8 +628,7 @@ public class SimpleMessage private constructor( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt index 4bdebb2677..69efa22d9d 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt @@ -41,8 +41,7 @@ public class NestedVersionOne( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -68,8 +67,7 @@ public class NestedVersionOne( return result.joinToString(prefix = "NestedVersionOne{", separator = ", ", postfix = "}") } - public fun copy(i: Int? = this.i, unknownFields: ByteString = this.unknownFields): - NestedVersionOne = NestedVersionOne(i, unknownFields) + public fun copy(i: Int? = this.i, unknownFields: ByteString = this.unknownFields): NestedVersionOne = NestedVersionOne(i, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt index 136b4fc97c..0de7238003 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt @@ -77,8 +77,7 @@ public class NestedVersionTwo( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionOne.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionOne.kt index e619a2ff56..2851f546e1 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionOne.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionOne.kt @@ -53,8 +53,7 @@ public class VersionOne( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionTwo.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionTwo.kt index 2907b2bf6b..0a27448945 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionTwo.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/VersionTwo.kt @@ -89,8 +89,7 @@ public class VersionTwo( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/usesany/UsesAny.kt b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/usesany/UsesAny.kt index 6d86dfad6b..d2dc546ff3 100644 --- a/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/usesany/UsesAny.kt +++ b/wire-tests/src/commonTest/proto-kotlin/com/squareup/wire/protos/usesany/UsesAny.kt @@ -54,8 +54,7 @@ public class UsesAny( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/commonTest/proto-kotlin/squareup/proto2/keywords/KeywordKotlin.kt b/wire-tests/src/commonTest/proto-kotlin/squareup/proto2/keywords/KeywordKotlin.kt index 4e336cda8f..295d3cb2cb 100644 --- a/wire-tests/src/commonTest/proto-kotlin/squareup/proto2/keywords/KeywordKotlin.kt +++ b/wire-tests/src/commonTest/proto-kotlin/squareup/proto2/keywords/KeywordKotlin.kt @@ -85,8 +85,7 @@ public class KeywordKotlin( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -143,8 +142,8 @@ public class KeywordKotlin( null, "keyword_kotlin.proto" ) { - private val funAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val funAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } override fun encodedSize(`value`: KeywordKotlin): Int { var size = value.unknownFields.size @@ -233,8 +232,7 @@ public class KeywordKotlin( PROTO_2, KeywordKotlinEnum.`object` ) { - override fun fromValue(`value`: Int): KeywordKotlinEnum? = - KeywordKotlinEnum.fromValue(`value`) + override fun fromValue(`value`: Int): KeywordKotlinEnum? = KeywordKotlinEnum.fromValue(`value`) } @JvmStatic diff --git a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/opaque_types/OuterOpaqueType.kt b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/opaque_types/OuterOpaqueType.kt index 72de7ec22d..47d906e61f 100644 --- a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/opaque_types/OuterOpaqueType.kt +++ b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/opaque_types/OuterOpaqueType.kt @@ -48,8 +48,7 @@ public class OuterOpaqueType( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -153,8 +152,7 @@ public class OuterOpaqueType( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -180,8 +178,7 @@ public class OuterOpaqueType( return result.joinToString(prefix = "InnerOpaqueType1{", separator = ", ", postfix = "}") } - public fun copy(value_: String? = this.value_, unknownFields: ByteString = this.unknownFields): - InnerOpaqueType1 = InnerOpaqueType1(value_, unknownFields) + public fun copy(value_: String? = this.value_, unknownFields: ByteString = this.unknownFields): InnerOpaqueType1 = InnerOpaqueType1(value_, unknownFields) public companion object { @JvmField @@ -246,8 +243,7 @@ public class OuterOpaqueType( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -273,8 +269,7 @@ public class OuterOpaqueType( return result.joinToString(prefix = "InnerOpaqueType2{", separator = ", ", postfix = "}") } - public fun copy(value_: String? = this.value_, unknownFields: ByteString = this.unknownFields): - InnerOpaqueType2 = InnerOpaqueType2(value_, unknownFields) + public fun copy(value_: String? = this.value_, unknownFields: ByteString = this.unknownFields): InnerOpaqueType2 = InnerOpaqueType2(value_, unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt index 05e7074dbf..5e496a753d 100644 --- a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt @@ -46,15 +46,14 @@ public class EmbeddedMessage( label = WireField.Label.PACKED, schemaIndex = 0, ) - public val inner_repeated_number: List = immutableCopyOf("inner_repeated_number", - inner_repeated_number) + public val inner_repeated_number: List = + immutableCopyOf("inner_repeated_number", inner_repeated_number) @Deprecated( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -78,8 +77,7 @@ public class EmbeddedMessage( override fun toString(): String { val result = mutableListOf() - if (inner_repeated_number.isNotEmpty()) result += - """inner_repeated_number=$inner_repeated_number""" + if (inner_repeated_number.isNotEmpty()) result += """inner_repeated_number=$inner_repeated_number""" if (inner_number_after != null) result += """inner_number_after=$inner_number_after""" return result.joinToString(prefix = "EmbeddedMessage{", separator = ", ", postfix = "}") } diff --git a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/OuterMessage.kt b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/OuterMessage.kt index 9fb9c3d128..0e309e4b53 100644 --- a/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/OuterMessage.kt +++ b/wire-tests/src/commonTest/proto-kotlin/squareup/protos/packed_encoding/OuterMessage.kt @@ -47,8 +47,7 @@ public class OuterMessage( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto2/alltypes/AllTypes.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto2/alltypes/AllTypes.kt index f5bea996f5..663dae0c01 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto2/alltypes/AllTypes.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto2/alltypes/AllTypes.kt @@ -822,8 +822,8 @@ public class AllTypes( schemaIndex = 50, ) @JvmField - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 301, @@ -949,8 +949,8 @@ public class AllTypes( schemaIndex = 64, ) @JvmField - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 501, @@ -968,8 +968,8 @@ public class AllTypes( schemaIndex = 82, ) @JvmField - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -978,8 +978,8 @@ public class AllTypes( schemaIndex = 83, ) @JvmField - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -988,8 +988,8 @@ public class AllTypes( schemaIndex = 84, ) @JvmField - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) /** * Extension source: all_types_proto2.proto @@ -1181,8 +1181,8 @@ public class AllTypes( schemaIndex = 120, ) @JvmField - public val ext_rep_nested_enum: List = immutableCopyOf("ext_rep_nested_enum", - ext_rep_nested_enum) + public val ext_rep_nested_enum: List = + immutableCopyOf("ext_rep_nested_enum", ext_rep_nested_enum) /** * Extension source: all_types_proto2.proto @@ -1194,8 +1194,8 @@ public class AllTypes( schemaIndex = 121, ) @JvmField - public val ext_rep_nested_message: List = immutableCopyOf("ext_rep_nested_message", - ext_rep_nested_message) + public val ext_rep_nested_message: List = + immutableCopyOf("ext_rep_nested_message", ext_rep_nested_message) /** * Extension source: all_types_proto2.proto @@ -1363,8 +1363,8 @@ public class AllTypes( schemaIndex = 135, ) @JvmField - public val ext_pack_nested_enum: List = immutableCopyOf("ext_pack_nested_enum", - ext_pack_nested_enum) + public val ext_pack_nested_enum: List = + immutableCopyOf("ext_pack_nested_enum", ext_pack_nested_enum) init { require(countNonNull(oneof_string, oneof_int32, oneof_nested_message) <= 1) { @@ -1908,8 +1908,7 @@ public class AllTypes( if (ext_opt_string != null) result += """ext_opt_string=${sanitize(ext_opt_string)}""" if (ext_opt_bytes != null) result += """ext_opt_bytes=$ext_opt_bytes""" if (ext_opt_nested_enum != null) result += """ext_opt_nested_enum=$ext_opt_nested_enum""" - if (ext_opt_nested_message != null) result += - """ext_opt_nested_message=$ext_opt_nested_message""" + if (ext_opt_nested_message != null) result += """ext_opt_nested_message=$ext_opt_nested_message""" if (ext_rep_int32.isNotEmpty()) result += """ext_rep_int32=$ext_rep_int32""" if (ext_rep_uint32.isNotEmpty()) result += """ext_rep_uint32=$ext_rep_uint32""" if (ext_rep_sint32.isNotEmpty()) result += """ext_rep_sint32=$ext_rep_sint32""" @@ -1926,8 +1925,7 @@ public class AllTypes( if (ext_rep_string.isNotEmpty()) result += """ext_rep_string=${sanitize(ext_rep_string)}""" if (ext_rep_bytes.isNotEmpty()) result += """ext_rep_bytes=$ext_rep_bytes""" if (ext_rep_nested_enum.isNotEmpty()) result += """ext_rep_nested_enum=$ext_rep_nested_enum""" - if (ext_rep_nested_message.isNotEmpty()) result += - """ext_rep_nested_message=$ext_rep_nested_message""" + if (ext_rep_nested_message.isNotEmpty()) result += """ext_rep_nested_message=$ext_rep_nested_message""" if (ext_pack_int32.isNotEmpty()) result += """ext_pack_int32=$ext_pack_int32""" if (ext_pack_uint32.isNotEmpty()) result += """ext_pack_uint32=$ext_pack_uint32""" if (ext_pack_sint32.isNotEmpty()) result += """ext_pack_sint32=$ext_pack_sint32""" @@ -1941,8 +1939,7 @@ public class AllTypes( if (ext_pack_bool.isNotEmpty()) result += """ext_pack_bool=$ext_pack_bool""" if (ext_pack_float.isNotEmpty()) result += """ext_pack_float=$ext_pack_float""" if (ext_pack_double.isNotEmpty()) result += """ext_pack_double=$ext_pack_double""" - if (ext_pack_nested_enum.isNotEmpty()) result += - """ext_pack_nested_enum=$ext_pack_nested_enum""" + if (ext_pack_nested_enum.isNotEmpty()) result += """ext_pack_nested_enum=$ext_pack_nested_enum""" return result.joinToString(prefix = "AllTypes{", separator = ", ", postfix = "}") } @@ -2084,30 +2081,7 @@ public class AllTypes( ext_pack_double: List = this.ext_pack_double, ext_pack_nested_enum: List = this.ext_pack_nested_enum, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, - opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, - opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, - req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, - req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, - rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, - rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, - rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, - pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, - pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, - default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, - default_fixed64, default_sfixed64, default_bool, default_float, default_double, - default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, - map_string_message, map_string_enum, oneof_string, oneof_int32, oneof_nested_message, - ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, ext_opt_sfixed32, - ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, ext_opt_sfixed64, - ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, - ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, - ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, - ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, - ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, - ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, - ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, - ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) + ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, default_fixed64, default_sfixed64, default_bool, default_float, default_double, default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, map_string_message, map_string_enum, oneof_string, oneof_int32, oneof_nested_message, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -3299,10 +3273,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -3456,17 +3428,17 @@ public class AllTypes( null, "all_types_proto2.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -3591,8 +3563,7 @@ public class AllTypes( size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1_114, value.ext_rep_string) size += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(1_115, value.ext_rep_bytes) size += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(1_116, value.ext_rep_nested_enum) - size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, - value.ext_rep_nested_message) + size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, value.ext_rep_nested_message) size += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(1_201, value.ext_pack_int32) size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(1_202, value.ext_pack_uint32) size += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(1_203, value.ext_pack_sint32) @@ -3729,8 +3700,7 @@ public class AllTypes( ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) @@ -3770,8 +3740,7 @@ public class AllTypes( ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) @@ -4469,10 +4438,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -4664,8 +4631,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -4730,8 +4696,7 @@ public class AllTypes( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto3/alltypes/AllTypes.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto3/alltypes/AllTypes.kt index bc549ba75a..6ea4b2b646 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto3/alltypes/AllTypes.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/com/squareup/wire/proto3/alltypes/AllTypes.kt @@ -545,8 +545,8 @@ public class AllTypes( schemaIndex = 48, ) @JvmField - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 301, @@ -686,8 +686,8 @@ public class AllTypes( schemaIndex = 62, ) @JvmField - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 501, @@ -707,8 +707,8 @@ public class AllTypes( schemaIndex = 64, ) @JvmField - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -718,8 +718,8 @@ public class AllTypes( schemaIndex = 65, ) @JvmField - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -729,8 +729,8 @@ public class AllTypes( schemaIndex = 66, ) @JvmField - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) init { require(countNonNull(oneof_string, oneof_int32, oneof_nested_message) <= 1) { @@ -1117,17 +1117,7 @@ public class AllTypes( oneof_int32: Int? = this.oneof_int32, oneof_nested_message: NestedMessage? = this.oneof_nested_message, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(my_int32, my_uint32, my_sint32, my_fixed32, my_sfixed32, my_int64, - my_uint64, my_sint64, my_fixed64, my_sfixed64, my_bool, my_float, my_double, my_string, - my_bytes, nested_enum, nested_message, opt_int32, opt_uint32, opt_sint32, opt_fixed32, - opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, - opt_float, opt_double, opt_string, opt_bytes, rep_int32, rep_uint32, rep_sint32, rep_fixed32, - rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, - rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, - pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, - pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, - map_int32_int32, map_string_string, map_string_message, map_string_enum, oneof_string, - oneof_int32, oneof_nested_message, unknownFields) + ): AllTypes = AllTypes(my_int32, my_uint32, my_sint32, my_fixed32, my_sfixed32, my_int64, my_uint64, my_sint64, my_fixed64, my_sfixed64, my_bool, my_float, my_double, my_string, my_bytes, nested_enum, nested_message, opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, map_int32_int32, map_string_string, map_string_message, map_string_enum, oneof_string, oneof_int32, oneof_nested_message, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -1812,17 +1802,17 @@ public class AllTypes( null, "all_types_proto3_test_proto3_optional.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -2582,8 +2572,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -2654,8 +2643,7 @@ public class AllTypes( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All32.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All32.kt index b12801cf4a..4acb8e728f 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All32.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All32.kt @@ -254,8 +254,8 @@ public class All32( schemaIndex = 20, ) @JvmField - public val map_int32_fixed32: Map = immutableCopyOf("map_int32_fixed32", - map_int32_fixed32) + public val map_int32_fixed32: Map = + immutableCopyOf("map_int32_fixed32", map_int32_fixed32) @field:WireField( tag = 505, @@ -265,8 +265,8 @@ public class All32( schemaIndex = 21, ) @JvmField - public val map_int32_sfixed32: Map = immutableCopyOf("map_int32_sfixed32", - map_int32_sfixed32) + public val map_int32_sfixed32: Map = + immutableCopyOf("map_int32_sfixed32", map_int32_sfixed32) init { require(countNonNull(oneof_int32, oneof_sfixed32) <= 1) { @@ -413,10 +413,7 @@ public class All32( map_int32_fixed32: Map = this.map_int32_fixed32, map_int32_sfixed32: Map = this.map_int32_sfixed32, unknownFields: ByteString = this.unknownFields, - ): All32 = All32(my_int32, my_uint32, my_sint32, my_fixed32, my_sfixed32, rep_int32, rep_uint32, - rep_sint32, rep_fixed32, rep_sfixed32, pack_int32, pack_uint32, pack_sint32, pack_fixed32, - pack_sfixed32, oneof_int32, oneof_sfixed32, map_int32_int32, map_int32_uint32, - map_int32_sint32, map_int32_fixed32, map_int32_sfixed32, unknownFields) + ): All32 = All32(my_int32, my_uint32, my_sint32, my_fixed32, my_sfixed32, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, oneof_int32, oneof_sfixed32, map_int32_int32, map_int32_uint32, map_int32_sint32, map_int32_fixed32, map_int32_sfixed32, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -647,20 +644,20 @@ public class All32( null, "all32.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_int32_uint32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT32) } + private val map_int32_uint32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT32) } - private val map_int32_sint32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.SINT32) } + private val map_int32_sint32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.SINT32) } - private val map_int32_fixed32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.FIXED32) } + private val map_int32_fixed32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.FIXED32) } - private val map_int32_sfixed32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.SFIXED32) } + private val map_int32_sfixed32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.SFIXED32) } override fun encodedSize(`value`: All32): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All64.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All64.kt index 9c0f7c6a5b..6efacf7205 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All64.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/All64.kt @@ -234,8 +234,8 @@ public class All64( schemaIndex = 18, ) @JvmField - public val map_int64_uint64: Map = immutableCopyOf("map_int64_uint64", - map_int64_uint64) + public val map_int64_uint64: Map = + immutableCopyOf("map_int64_uint64", map_int64_uint64) @field:WireField( tag = 503, @@ -245,8 +245,8 @@ public class All64( schemaIndex = 19, ) @JvmField - public val map_int64_sint64: Map = immutableCopyOf("map_int64_sint64", - map_int64_sint64) + public val map_int64_sint64: Map = + immutableCopyOf("map_int64_sint64", map_int64_sint64) @field:WireField( tag = 504, @@ -256,8 +256,8 @@ public class All64( schemaIndex = 20, ) @JvmField - public val map_int64_fixed64: Map = immutableCopyOf("map_int64_fixed64", - map_int64_fixed64) + public val map_int64_fixed64: Map = + immutableCopyOf("map_int64_fixed64", map_int64_fixed64) @field:WireField( tag = 505, @@ -267,8 +267,8 @@ public class All64( schemaIndex = 21, ) @JvmField - public val map_int64_sfixed64: Map = immutableCopyOf("map_int64_sfixed64", - map_int64_sfixed64) + public val map_int64_sfixed64: Map = + immutableCopyOf("map_int64_sfixed64", map_int64_sfixed64) init { require(countNonNull(oneof_int64, oneof_sfixed64) <= 1) { @@ -415,10 +415,7 @@ public class All64( map_int64_fixed64: Map = this.map_int64_fixed64, map_int64_sfixed64: Map = this.map_int64_sfixed64, unknownFields: ByteString = this.unknownFields, - ): All64 = All64(my_int64, my_uint64, my_sint64, my_fixed64, my_sfixed64, rep_int64, rep_uint64, - rep_sint64, rep_fixed64, rep_sfixed64, pack_int64, pack_uint64, pack_sint64, pack_fixed64, - pack_sfixed64, oneof_int64, oneof_sfixed64, map_int64_int64, map_int64_uint64, - map_int64_sint64, map_int64_fixed64, map_int64_sfixed64, unknownFields) + ): All64 = All64(my_int64, my_uint64, my_sint64, my_fixed64, my_sfixed64, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, oneof_int64, oneof_sfixed64, map_int64_int64, map_int64_uint64, map_int64_sint64, map_int64_fixed64, map_int64_sfixed64, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -649,20 +646,20 @@ public class All64( null, "all64.proto" ) { - private val map_int64_int64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.INT64) } + private val map_int64_int64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.INT64) } - private val map_int64_uint64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.UINT64) } + private val map_int64_uint64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.UINT64) } - private val map_int64_sint64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.SINT64) } + private val map_int64_sint64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.SINT64) } - private val map_int64_fixed64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.FIXED64) } + private val map_int64_fixed64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.FIXED64) } - private val map_int64_sfixed64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.SFIXED64) } + private val map_int64_sfixed64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.SFIXED64) } override fun encodedSize(`value`: All64): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllStructs.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllStructs.kt index 97f0b66858..491b9ba1c0 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllStructs.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllStructs.kt @@ -183,8 +183,8 @@ public class AllStructs( schemaIndex = 12, ) @JvmField - public val rep_null_value: List = immutableCopyOfStruct("rep_null_value", - rep_null_value) + public val rep_null_value: List = + immutableCopyOfStruct("rep_null_value", rep_null_value) @field:WireField( tag = 201, @@ -355,8 +355,7 @@ public class AllStructs( if (map_int32_struct.isNotEmpty()) result += """map_int32_struct=$map_int32_struct""" if (map_int32_list.isNotEmpty()) result += """map_int32_list=$map_int32_list""" if (map_int32_value_a.isNotEmpty()) result += """map_int32_value_a=$map_int32_value_a""" - if (map_int32_null_value.isNotEmpty()) result += - """map_int32_null_value=$map_int32_null_value""" + if (map_int32_null_value.isNotEmpty()) result += """map_int32_null_value=$map_int32_null_value""" return result.joinToString(prefix = "AllStructs{", separator = ", ", postfix = "}") } @@ -381,9 +380,7 @@ public class AllStructs( map_int32_value_a: Map = this.map_int32_value_a, map_int32_null_value: Map = this.map_int32_null_value, unknownFields: ByteString = this.unknownFields, - ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, - value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, - map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) + ): AllStructs = AllStructs(struct, list, null_value, value_a, value_b, value_c, value_d, value_e, value_f, rep_struct, rep_list, rep_value_a, rep_null_value, oneof_struct, oneof_list, map_int32_struct, map_int32_list, map_int32_value_a, map_int32_null_value, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -578,17 +575,17 @@ public class AllStructs( null, "all_structs.proto" ) { - private val map_int32_structAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } + private val map_int32_structAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP) } - private val map_int32_listAdapter: ProtoAdapter?>> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } + private val map_int32_listAdapter: ProtoAdapter?>> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST) } - private val map_int32_value_aAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } + private val map_int32_value_aAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE) } - private val map_int32_null_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } + private val map_int32_null_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL) } override fun encodedSize(`value`: AllStructs): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllWrappers.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllWrappers.kt index 147724e01a..09a80d58b7 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllWrappers.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/AllWrappers.kt @@ -215,8 +215,8 @@ public class AllWrappers( schemaIndex = 17, ) @JvmField - public val rep_bytes_value: List = immutableCopyOf("rep_bytes_value", - rep_bytes_value) + public val rep_bytes_value: List = + immutableCopyOf("rep_bytes_value", rep_bytes_value) @field:WireField( tag = 301, @@ -226,8 +226,8 @@ public class AllWrappers( schemaIndex = 18, ) @JvmField - public val map_int32_double_value: Map = immutableCopyOf("map_int32_double_value", - map_int32_double_value) + public val map_int32_double_value: Map = + immutableCopyOf("map_int32_double_value", map_int32_double_value) @field:WireField( tag = 302, @@ -237,8 +237,8 @@ public class AllWrappers( schemaIndex = 19, ) @JvmField - public val map_int32_float_value: Map = immutableCopyOf("map_int32_float_value", - map_int32_float_value) + public val map_int32_float_value: Map = + immutableCopyOf("map_int32_float_value", map_int32_float_value) @field:WireField( tag = 303, @@ -248,8 +248,8 @@ public class AllWrappers( schemaIndex = 20, ) @JvmField - public val map_int32_int64_value: Map = immutableCopyOf("map_int32_int64_value", - map_int32_int64_value) + public val map_int32_int64_value: Map = + immutableCopyOf("map_int32_int64_value", map_int32_int64_value) @field:WireField( tag = 304, @@ -259,8 +259,8 @@ public class AllWrappers( schemaIndex = 21, ) @JvmField - public val map_int32_uint64_value: Map = immutableCopyOf("map_int32_uint64_value", - map_int32_uint64_value) + public val map_int32_uint64_value: Map = + immutableCopyOf("map_int32_uint64_value", map_int32_uint64_value) @field:WireField( tag = 305, @@ -270,8 +270,8 @@ public class AllWrappers( schemaIndex = 22, ) @JvmField - public val map_int32_int32_value: Map = immutableCopyOf("map_int32_int32_value", - map_int32_int32_value) + public val map_int32_int32_value: Map = + immutableCopyOf("map_int32_int32_value", map_int32_int32_value) @field:WireField( tag = 306, @@ -281,8 +281,8 @@ public class AllWrappers( schemaIndex = 23, ) @JvmField - public val map_int32_uint32_value: Map = immutableCopyOf("map_int32_uint32_value", - map_int32_uint32_value) + public val map_int32_uint32_value: Map = + immutableCopyOf("map_int32_uint32_value", map_int32_uint32_value) @field:WireField( tag = 307, @@ -292,8 +292,8 @@ public class AllWrappers( schemaIndex = 24, ) @JvmField - public val map_int32_bool_value: Map = immutableCopyOf("map_int32_bool_value", - map_int32_bool_value) + public val map_int32_bool_value: Map = + immutableCopyOf("map_int32_bool_value", map_int32_bool_value) @field:WireField( tag = 308, @@ -303,8 +303,8 @@ public class AllWrappers( schemaIndex = 25, ) @JvmField - public val map_int32_string_value: Map = immutableCopyOf("map_int32_string_value", - map_int32_string_value) + public val map_int32_string_value: Map = + immutableCopyOf("map_int32_string_value", map_int32_string_value) @field:WireField( tag = 309, @@ -314,8 +314,8 @@ public class AllWrappers( schemaIndex = 26, ) @JvmField - public val map_int32_bytes_value: Map = immutableCopyOf("map_int32_bytes_value", - map_int32_bytes_value) + public val map_int32_bytes_value: Map = + immutableCopyOf("map_int32_bytes_value", map_int32_bytes_value) override fun newBuilder(): Builder { val builder = Builder() @@ -440,24 +440,15 @@ public class AllWrappers( if (rep_bool_value.isNotEmpty()) result += """rep_bool_value=$rep_bool_value""" if (rep_string_value.isNotEmpty()) result += """rep_string_value=$rep_string_value""" if (rep_bytes_value.isNotEmpty()) result += """rep_bytes_value=$rep_bytes_value""" - if (map_int32_double_value.isNotEmpty()) result += - """map_int32_double_value=$map_int32_double_value""" - if (map_int32_float_value.isNotEmpty()) result += - """map_int32_float_value=$map_int32_float_value""" - if (map_int32_int64_value.isNotEmpty()) result += - """map_int32_int64_value=$map_int32_int64_value""" - if (map_int32_uint64_value.isNotEmpty()) result += - """map_int32_uint64_value=$map_int32_uint64_value""" - if (map_int32_int32_value.isNotEmpty()) result += - """map_int32_int32_value=$map_int32_int32_value""" - if (map_int32_uint32_value.isNotEmpty()) result += - """map_int32_uint32_value=$map_int32_uint32_value""" - if (map_int32_bool_value.isNotEmpty()) result += - """map_int32_bool_value=$map_int32_bool_value""" - if (map_int32_string_value.isNotEmpty()) result += - """map_int32_string_value=$map_int32_string_value""" - if (map_int32_bytes_value.isNotEmpty()) result += - """map_int32_bytes_value=$map_int32_bytes_value""" + if (map_int32_double_value.isNotEmpty()) result += """map_int32_double_value=$map_int32_double_value""" + if (map_int32_float_value.isNotEmpty()) result += """map_int32_float_value=$map_int32_float_value""" + if (map_int32_int64_value.isNotEmpty()) result += """map_int32_int64_value=$map_int32_int64_value""" + if (map_int32_uint64_value.isNotEmpty()) result += """map_int32_uint64_value=$map_int32_uint64_value""" + if (map_int32_int32_value.isNotEmpty()) result += """map_int32_int32_value=$map_int32_int32_value""" + if (map_int32_uint32_value.isNotEmpty()) result += """map_int32_uint32_value=$map_int32_uint32_value""" + if (map_int32_bool_value.isNotEmpty()) result += """map_int32_bool_value=$map_int32_bool_value""" + if (map_int32_string_value.isNotEmpty()) result += """map_int32_string_value=$map_int32_string_value""" + if (map_int32_bytes_value.isNotEmpty()) result += """map_int32_bytes_value=$map_int32_bytes_value""" return result.joinToString(prefix = "AllWrappers{", separator = ", ", postfix = "}") } @@ -490,12 +481,7 @@ public class AllWrappers( map_int32_string_value: Map = this.map_int32_string_value, map_int32_bytes_value: Map = this.map_int32_bytes_value, unknownFields: ByteString = this.unknownFields, - ): AllWrappers = AllWrappers(double_value, float_value, int64_value, uint64_value, int32_value, - uint32_value, bool_value, string_value, bytes_value, rep_double_value, rep_float_value, - rep_int64_value, rep_uint64_value, rep_int32_value, rep_uint32_value, rep_bool_value, - rep_string_value, rep_bytes_value, map_int32_double_value, map_int32_float_value, - map_int32_int64_value, map_int32_uint64_value, map_int32_int32_value, map_int32_uint32_value, - map_int32_bool_value, map_int32_string_value, map_int32_bytes_value, unknownFields) + ): AllWrappers = AllWrappers(double_value, float_value, int64_value, uint64_value, int32_value, uint32_value, bool_value, string_value, bytes_value, rep_double_value, rep_float_value, rep_int64_value, rep_uint64_value, rep_int32_value, rep_uint32_value, rep_bool_value, rep_string_value, rep_bytes_value, map_int32_double_value, map_int32_float_value, map_int32_int64_value, map_int32_uint64_value, map_int32_int32_value, map_int32_uint32_value, map_int32_bool_value, map_int32_string_value, map_int32_bytes_value, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -765,32 +751,32 @@ public class AllWrappers( null, "all_wrappers.proto" ) { - private val map_int32_double_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.DOUBLE_VALUE) } + private val map_int32_double_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.DOUBLE_VALUE) } - private val map_int32_float_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.FLOAT_VALUE) } + private val map_int32_float_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.FLOAT_VALUE) } - private val map_int32_int64_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT64_VALUE) } + private val map_int32_int64_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT64_VALUE) } - private val map_int32_uint64_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT64_VALUE) } + private val map_int32_uint64_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT64_VALUE) } - private val map_int32_int32_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32_VALUE) } + private val map_int32_int32_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32_VALUE) } - private val map_int32_uint32_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT32_VALUE) } + private val map_int32_uint32_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.UINT32_VALUE) } - private val map_int32_bool_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.BOOL_VALUE) } + private val map_int32_bool_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.BOOL_VALUE) } - private val map_int32_string_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING_VALUE) } + private val map_int32_string_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRING_VALUE) } - private val map_int32_bytes_valueAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.BYTES_VALUE) } + private val map_int32_bytes_valueAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.BYTES_VALUE) } override fun encodedSize(`value`: AllWrappers): Int { var size = value.unknownFields.size @@ -821,18 +807,14 @@ public class AllWrappers( if (value.bytes_value != null) { size += ProtoAdapter.BYTES_VALUE.encodedSizeWithTag(9, value.bytes_value) } - size += ProtoAdapter.DOUBLE_VALUE.asRepeated().encodedSizeWithTag(101, - value.rep_double_value) + size += ProtoAdapter.DOUBLE_VALUE.asRepeated().encodedSizeWithTag(101, value.rep_double_value) size += ProtoAdapter.FLOAT_VALUE.asRepeated().encodedSizeWithTag(102, value.rep_float_value) size += ProtoAdapter.INT64_VALUE.asRepeated().encodedSizeWithTag(103, value.rep_int64_value) - size += ProtoAdapter.UINT64_VALUE.asRepeated().encodedSizeWithTag(104, - value.rep_uint64_value) + size += ProtoAdapter.UINT64_VALUE.asRepeated().encodedSizeWithTag(104, value.rep_uint64_value) size += ProtoAdapter.INT32_VALUE.asRepeated().encodedSizeWithTag(105, value.rep_int32_value) - size += ProtoAdapter.UINT32_VALUE.asRepeated().encodedSizeWithTag(106, - value.rep_uint32_value) + size += ProtoAdapter.UINT32_VALUE.asRepeated().encodedSizeWithTag(106, value.rep_uint32_value) size += ProtoAdapter.BOOL_VALUE.asRepeated().encodedSizeWithTag(107, value.rep_bool_value) - size += ProtoAdapter.STRING_VALUE.asRepeated().encodedSizeWithTag(108, - value.rep_string_value) + size += ProtoAdapter.STRING_VALUE.asRepeated().encodedSizeWithTag(108, value.rep_string_value) size += ProtoAdapter.BYTES_VALUE.asRepeated().encodedSizeWithTag(109, value.rep_bytes_value) size += map_int32_double_valueAdapter.encodedSizeWithTag(301, value.map_int32_double_value) size += map_int32_float_valueAdapter.encodedSizeWithTag(302, value.map_int32_float_value) @@ -1055,23 +1037,15 @@ public class AllWrappers( rep_bool_value = value.rep_bool_value.redactElements(ProtoAdapter.BOOL_VALUE), rep_string_value = value.rep_string_value.redactElements(ProtoAdapter.STRING_VALUE), rep_bytes_value = value.rep_bytes_value.redactElements(ProtoAdapter.BYTES_VALUE), - map_int32_double_value = - value.map_int32_double_value.redactElements(ProtoAdapter.DOUBLE_VALUE), - map_int32_float_value = - value.map_int32_float_value.redactElements(ProtoAdapter.FLOAT_VALUE), - map_int32_int64_value = - value.map_int32_int64_value.redactElements(ProtoAdapter.INT64_VALUE), - map_int32_uint64_value = - value.map_int32_uint64_value.redactElements(ProtoAdapter.UINT64_VALUE), - map_int32_int32_value = - value.map_int32_int32_value.redactElements(ProtoAdapter.INT32_VALUE), - map_int32_uint32_value = - value.map_int32_uint32_value.redactElements(ProtoAdapter.UINT32_VALUE), + map_int32_double_value = value.map_int32_double_value.redactElements(ProtoAdapter.DOUBLE_VALUE), + map_int32_float_value = value.map_int32_float_value.redactElements(ProtoAdapter.FLOAT_VALUE), + map_int32_int64_value = value.map_int32_int64_value.redactElements(ProtoAdapter.INT64_VALUE), + map_int32_uint64_value = value.map_int32_uint64_value.redactElements(ProtoAdapter.UINT64_VALUE), + map_int32_int32_value = value.map_int32_int32_value.redactElements(ProtoAdapter.INT32_VALUE), + map_int32_uint32_value = value.map_int32_uint32_value.redactElements(ProtoAdapter.UINT32_VALUE), map_int32_bool_value = value.map_int32_bool_value.redactElements(ProtoAdapter.BOOL_VALUE), - map_int32_string_value = - value.map_int32_string_value.redactElements(ProtoAdapter.STRING_VALUE), - map_int32_bytes_value = - value.map_int32_bytes_value.redactElements(ProtoAdapter.BYTES_VALUE), + map_int32_string_value = value.map_int32_string_value.redactElements(ProtoAdapter.STRING_VALUE), + map_int32_bytes_value = value.map_int32_bytes_value.redactElements(ProtoAdapter.BYTES_VALUE), unknownFields = ByteString.EMPTY ) } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/BuyOneGetOnePromotion.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/BuyOneGetOnePromotion.kt index c78485cc36..ac17844299 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/BuyOneGetOnePromotion.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/BuyOneGetOnePromotion.kt @@ -69,8 +69,7 @@ public class BuyOneGetOnePromotion( return result.joinToString(prefix = "BuyOneGetOnePromotion{", separator = ", ", postfix = "}") } - public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): - BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) + public fun copy(coupon: String = this.coupon, unknownFields: ByteString = this.unknownFields): BuyOneGetOnePromotion = BuyOneGetOnePromotion(coupon, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -89,8 +88,8 @@ public class BuyOneGetOnePromotion( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, BuyOneGetOnePromotion::class, "type.googleapis.com/squareup.proto3.BuyOneGetOnePromotion", @@ -142,7 +141,6 @@ public class BuyOneGetOnePromotion( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): BuyOneGetOnePromotion = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): BuyOneGetOnePromotion = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/CamelCase.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/CamelCase.kt index 6e8d0ea685..be1a918fcb 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/CamelCase.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/CamelCase.kt @@ -124,8 +124,7 @@ public class CamelCase( IDitIt_my_wAy: String = this.IDitIt_my_wAy, map_int32_Int32: Map = this.map_int32_Int32, unknownFields: ByteString = this.unknownFields, - ): CamelCase = CamelCase(nested__message, _Rep_int32, IDitIt_my_wAy, map_int32_Int32, - unknownFields) + ): CamelCase = CamelCase(nested__message, _Rep_int32, IDitIt_my_wAy, map_int32_Int32, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -180,8 +179,8 @@ public class CamelCase( null, "camel_case.proto" ) { - private val map_int32_Int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_Int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } override fun encodedSize(`value`: CamelCase): Int { var size = value.unknownFields.size @@ -307,8 +306,7 @@ public class CamelCase( return result.joinToString(prefix = "NestedCamelCase{", separator = ", ", postfix = "}") } - public fun copy(one_int32: Int = this.one_int32, unknownFields: ByteString = - this.unknownFields): NestedCamelCase = NestedCamelCase(one_int32, unknownFields) + public fun copy(one_int32: Int = this.one_int32, unknownFields: ByteString = this.unknownFields): NestedCamelCase = NestedCamelCase(one_int32, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -379,8 +377,7 @@ public class CamelCase( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedCamelCase = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedCamelCase = Builder().apply(body).build() } } } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeDrinkPromotion.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeDrinkPromotion.kt index 66bfa14bc2..eedbab369b 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeDrinkPromotion.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeDrinkPromotion.kt @@ -71,8 +71,7 @@ public class FreeDrinkPromotion( return result.joinToString(prefix = "FreeDrinkPromotion{", separator = ", ", postfix = "}") } - public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): - FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) + public fun copy(drink: Drink = this.drink, unknownFields: ByteString = this.unknownFields): FreeDrinkPromotion = FreeDrinkPromotion(drink, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -91,8 +90,8 @@ public class FreeDrinkPromotion( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeDrinkPromotion::class, "type.googleapis.com/squareup.proto3.FreeDrinkPromotion", @@ -148,8 +147,7 @@ public class FreeDrinkPromotion( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): FreeDrinkPromotion = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): FreeDrinkPromotion = Builder().apply(body).build() } public enum class Drink( diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeGarlicBreadPromotion.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeGarlicBreadPromotion.kt index 66f1e9d530..1847a8d8c5 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeGarlicBreadPromotion.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/FreeGarlicBreadPromotion.kt @@ -66,13 +66,10 @@ public class FreeGarlicBreadPromotion( override fun toString(): String { val result = mutableListOf() result += """is_extra_cheesey=$is_extra_cheesey""" - return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = - "}") + return result.joinToString(prefix = "FreeGarlicBreadPromotion{", separator = ", ", postfix = "}") } - public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = - this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, - unknownFields) + public fun copy(is_extra_cheesey: Boolean = this.is_extra_cheesey, unknownFields: ByteString = this.unknownFields): FreeGarlicBreadPromotion = FreeGarlicBreadPromotion(is_extra_cheesey, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -91,8 +88,8 @@ public class FreeGarlicBreadPromotion( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, FreeGarlicBreadPromotion::class, "type.googleapis.com/squareup.proto3.FreeGarlicBreadPromotion", @@ -144,7 +141,6 @@ public class FreeGarlicBreadPromotion( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): FreeGarlicBreadPromotion = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): FreeGarlicBreadPromotion = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/MapTypes.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/MapTypes.kt index c34e2d9812..02bbaea308 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/MapTypes.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/MapTypes.kt @@ -51,8 +51,8 @@ public class MapTypes( schemaIndex = 0, ) @JvmField - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 2, @@ -72,8 +72,8 @@ public class MapTypes( schemaIndex = 2, ) @JvmField - public val map_sint32_sint32: Map = immutableCopyOf("map_sint32_sint32", - map_sint32_sint32) + public val map_sint32_sint32: Map = + immutableCopyOf("map_sint32_sint32", map_sint32_sint32) @field:WireField( tag = 4, @@ -83,8 +83,8 @@ public class MapTypes( schemaIndex = 3, ) @JvmField - public val map_sfixed32_sfixed32: Map = immutableCopyOf("map_sfixed32_sfixed32", - map_sfixed32_sfixed32) + public val map_sfixed32_sfixed32: Map = + immutableCopyOf("map_sfixed32_sfixed32", map_sfixed32_sfixed32) @field:WireField( tag = 5, @@ -94,8 +94,8 @@ public class MapTypes( schemaIndex = 4, ) @JvmField - public val map_fixed32_fixed32: Map = immutableCopyOf("map_fixed32_fixed32", - map_fixed32_fixed32) + public val map_fixed32_fixed32: Map = + immutableCopyOf("map_fixed32_fixed32", map_fixed32_fixed32) @field:WireField( tag = 6, @@ -105,8 +105,8 @@ public class MapTypes( schemaIndex = 5, ) @JvmField - public val map_uint32_uint32: Map = immutableCopyOf("map_uint32_uint32", - map_uint32_uint32) + public val map_uint32_uint32: Map = + immutableCopyOf("map_uint32_uint32", map_uint32_uint32) @field:WireField( tag = 7, @@ -126,8 +126,8 @@ public class MapTypes( schemaIndex = 7, ) @JvmField - public val map_sfixed64_sfixed64: Map = immutableCopyOf("map_sfixed64_sfixed64", - map_sfixed64_sfixed64) + public val map_sfixed64_sfixed64: Map = + immutableCopyOf("map_sfixed64_sfixed64", map_sfixed64_sfixed64) @field:WireField( tag = 9, @@ -137,8 +137,8 @@ public class MapTypes( schemaIndex = 8, ) @JvmField - public val map_sint64_sint64: Map = immutableCopyOf("map_sint64_sint64", - map_sint64_sint64) + public val map_sint64_sint64: Map = + immutableCopyOf("map_sint64_sint64", map_sint64_sint64) @field:WireField( tag = 10, @@ -148,8 +148,8 @@ public class MapTypes( schemaIndex = 9, ) @JvmField - public val map_fixed64_fixed64: Map = immutableCopyOf("map_fixed64_fixed64", - map_fixed64_fixed64) + public val map_fixed64_fixed64: Map = + immutableCopyOf("map_fixed64_fixed64", map_fixed64_fixed64) @field:WireField( tag = 11, @@ -159,8 +159,8 @@ public class MapTypes( schemaIndex = 10, ) @JvmField - public val map_uint64_uint64: Map = immutableCopyOf("map_uint64_uint64", - map_uint64_uint64) + public val map_uint64_uint64: Map = + immutableCopyOf("map_uint64_uint64", map_uint64_uint64) override fun newBuilder(): Builder { val builder = Builder() @@ -222,13 +222,11 @@ public class MapTypes( if (map_string_string.isNotEmpty()) result += """map_string_string=$map_string_string""" if (map_int32_int32.isNotEmpty()) result += """map_int32_int32=$map_int32_int32""" if (map_sint32_sint32.isNotEmpty()) result += """map_sint32_sint32=$map_sint32_sint32""" - if (map_sfixed32_sfixed32.isNotEmpty()) result += - """map_sfixed32_sfixed32=$map_sfixed32_sfixed32""" + if (map_sfixed32_sfixed32.isNotEmpty()) result += """map_sfixed32_sfixed32=$map_sfixed32_sfixed32""" if (map_fixed32_fixed32.isNotEmpty()) result += """map_fixed32_fixed32=$map_fixed32_fixed32""" if (map_uint32_uint32.isNotEmpty()) result += """map_uint32_uint32=$map_uint32_uint32""" if (map_int64_int64.isNotEmpty()) result += """map_int64_int64=$map_int64_int64""" - if (map_sfixed64_sfixed64.isNotEmpty()) result += - """map_sfixed64_sfixed64=$map_sfixed64_sfixed64""" + if (map_sfixed64_sfixed64.isNotEmpty()) result += """map_sfixed64_sfixed64=$map_sfixed64_sfixed64""" if (map_sint64_sint64.isNotEmpty()) result += """map_sint64_sint64=$map_sint64_sint64""" if (map_fixed64_fixed64.isNotEmpty()) result += """map_fixed64_fixed64=$map_fixed64_fixed64""" if (map_uint64_uint64.isNotEmpty()) result += """map_uint64_uint64=$map_uint64_uint64""" @@ -248,10 +246,7 @@ public class MapTypes( map_fixed64_fixed64: Map = this.map_fixed64_fixed64, map_uint64_uint64: Map = this.map_uint64_uint64, unknownFields: ByteString = this.unknownFields, - ): MapTypes = MapTypes(map_string_string, map_int32_int32, map_sint32_sint32, - map_sfixed32_sfixed32, map_fixed32_fixed32, map_uint32_uint32, map_int64_int64, - map_sfixed64_sfixed64, map_sint64_sint64, map_fixed64_fixed64, map_uint64_uint64, - unknownFields) + ): MapTypes = MapTypes(map_string_string, map_int32_int32, map_sint32_sint32, map_sfixed32_sfixed32, map_fixed32_fixed32, map_uint32_uint32, map_int64_int64, map_sfixed64_sfixed64, map_sint64_sint64, map_fixed64_fixed64, map_uint64_uint64, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -368,38 +363,38 @@ public class MapTypes( null, "map_types.proto" ) { - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_sint32_sint32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, ProtoAdapter.SINT32) } + private val map_sint32_sint32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, ProtoAdapter.SINT32) } - private val map_sfixed32_sfixed32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SFIXED32, ProtoAdapter.SFIXED32) } + private val map_sfixed32_sfixed32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SFIXED32, ProtoAdapter.SFIXED32) } - private val map_fixed32_fixed32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.FIXED32, ProtoAdapter.FIXED32) } + private val map_fixed32_fixed32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.FIXED32, ProtoAdapter.FIXED32) } - private val map_uint32_uint32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.UINT32, ProtoAdapter.UINT32) } + private val map_uint32_uint32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.UINT32, ProtoAdapter.UINT32) } - private val map_int64_int64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.INT64) } + private val map_int64_int64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT64, ProtoAdapter.INT64) } - private val map_sfixed64_sfixed64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SFIXED64, ProtoAdapter.SFIXED64) } + private val map_sfixed64_sfixed64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SFIXED64, ProtoAdapter.SFIXED64) } - private val map_sint64_sint64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, ProtoAdapter.SINT64) } + private val map_sint64_sint64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, ProtoAdapter.SINT64) } - private val map_fixed64_fixed64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.FIXED64, ProtoAdapter.FIXED64) } + private val map_fixed64_fixed64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.FIXED64, ProtoAdapter.FIXED64) } - private val map_uint64_uint64Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.UINT64, ProtoAdapter.UINT64) } + private val map_uint64_uint64Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.UINT64, ProtoAdapter.UINT64) } override fun encodedSize(`value`: MapTypes): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/Pizza.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/Pizza.kt index 1afc8be939..891258397b 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/Pizza.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/Pizza.kt @@ -74,8 +74,7 @@ public class Pizza( return result.joinToString(prefix = "Pizza{", separator = ", ", postfix = "}") } - public fun copy(toppings: List = this.toppings, unknownFields: ByteString = - this.unknownFields): Pizza = Pizza(toppings, unknownFields) + public fun copy(toppings: List = this.toppings, unknownFields: ByteString = this.unknownFields): Pizza = Pizza(toppings, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/PizzaDelivery.kt b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/PizzaDelivery.kt index 426187b4ce..cb43998dbe 100644 --- a/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/PizzaDelivery.kt +++ b/wire-tests/src/jvmJsonKotlinTest/proto-kotlin/squareup/proto3/PizzaDelivery.kt @@ -151,8 +151,7 @@ public class PizzaDelivery( result += """address=${sanitize(address)}""" if (pizzas.isNotEmpty()) result += """pizzas=$pizzas""" if (promotion != null) result += """promotion=$promotion""" - if (delivered_within_or_free != null) result += - """delivered_within_or_free=$delivered_within_or_free""" + if (delivered_within_or_free != null) result += """delivered_within_or_free=$delivered_within_or_free""" if (loyalty != null) result += """loyalty=$loyalty""" if (ordered_at != null) result += """ordered_at=$ordered_at""" return result.joinToString(prefix = "PizzaDelivery{", separator = ", ", postfix = "}") @@ -167,8 +166,7 @@ public class PizzaDelivery( loyalty: Map? = this.loyalty, ordered_at: Instant? = this.ordered_at, unknownFields: ByteString = this.unknownFields, - ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, - delivered_within_or_free, loyalty, ordered_at, unknownFields) + ): PizzaDelivery = PizzaDelivery(phone_number, address, pizzas, promotion, delivered_within_or_free, loyalty, ordered_at, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -355,8 +353,7 @@ public class PizzaDelivery( override fun redact(`value`: PizzaDelivery): PizzaDelivery = value.copy( pizzas = value.pizzas.redactElements(Pizza.ADAPTER), promotion = value.promotion?.let(AnyMessage.ADAPTER::redact), - delivered_within_or_free = - value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), + delivered_within_or_free = value.delivered_within_or_free?.let(ProtoAdapter.DURATION::redact), loyalty = value.loyalty?.let(ProtoAdapter.STRUCT_MAP::redact), ordered_at = value.ordered_at?.let(ProtoAdapter.INSTANT::redact), unknownFields = ByteString.EMPTY diff --git a/wire-tests/src/jvmKotlinAndroidTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt b/wire-tests/src/jvmKotlinAndroidTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt index 2310ff16dc..c322970f31 100644 --- a/wire-tests/src/jvmKotlinAndroidTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt +++ b/wire-tests/src/jvmKotlinAndroidTest/proto-kotlin/com/squareup/wire/protos/kotlin/person/Person.kt @@ -97,8 +97,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -281,8 +280,7 @@ public class Person( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/ModelEvaluation.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/ModelEvaluation.kt index f56ee840e7..efe662e04a 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/ModelEvaluation.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/ModelEvaluation.kt @@ -161,8 +161,8 @@ public class ModelEvaluation( null, "recursive_map.proto" ) { - private val modelsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ModelEvaluation.ADAPTER) } + private val modelsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ModelEvaluation.ADAPTER) } override fun encodedSize(`value`: ModelEvaluation): Int { var size = value.unknownFields.size @@ -215,7 +215,6 @@ public class ModelEvaluation( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): ModelEvaluation = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): ModelEvaluation = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt index f1dab152d1..c1df5acf2d 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/FooBar.kt @@ -487,8 +487,7 @@ public class FooBar( return result.joinToString(prefix = "Nested{", separator = ", ", postfix = "}") } - public fun copy(value_: FooBarBazEnum? = this.value_, unknownFields: ByteString = - this.unknownFields): Nested = Nested(value_, unknownFields) + public fun copy(value_: FooBarBazEnum? = this.value_, unknownFields: ByteString = this.unknownFields): Nested = Nested(value_, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -605,8 +604,7 @@ public class FooBar( return result.joinToString(prefix = "More{", separator = ", ", postfix = "}") } - public fun copy(serial: List = this.serial, unknownFields: ByteString = - this.unknownFields): More = More(serial, unknownFields) + public fun copy(serial: List = this.serial, unknownFields: ByteString = this.unknownFields): More = More(serial, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt index 3a3ef87764..7b928c70cf 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/custom_options/MessageWithOptions.kt @@ -58,8 +58,7 @@ public class MessageWithOptions( override fun toString(): String = "MessageWithOptions{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithOptions = - MessageWithOptions(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithOptions = MessageWithOptions(unknownFields) public class Builder : Message.Builder() { override fun build(): MessageWithOptions = MessageWithOptions( @@ -69,8 +68,8 @@ public class MessageWithOptions( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, MessageWithOptions::class, "type.googleapis.com/squareup.protos.custom_options.MessageWithOptions", @@ -106,7 +105,6 @@ public class MessageWithOptions( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): MessageWithOptions = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): MessageWithOptions = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt index aaec667aec..91b0f74d18 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/DeprecatedProto.kt @@ -70,8 +70,7 @@ public class DeprecatedProto( return result.joinToString(prefix = "DeprecatedProto{", separator = ", ", postfix = "}") } - public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): - DeprecatedProto = DeprecatedProto(foo, unknownFields) + public fun copy(foo: String? = this.foo, unknownFields: ByteString = this.unknownFields): DeprecatedProto = DeprecatedProto(foo, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -137,7 +136,6 @@ public class DeprecatedProto( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): DeprecatedProto = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): DeprecatedProto = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt index dfd7c9b33a..b8fbce76a7 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Form.kt @@ -187,81 +187,74 @@ public class Form( ) } - public val CHOICE_BUTTON_ELEMENT: Choice = Choice(tag = 1, adapter - = ButtonElement.ADAPTER, declaredName = "button_element") + public val CHOICE_BUTTON_ELEMENT: Choice = + Choice(tag = 1, adapter = ButtonElement.ADAPTER, declaredName = "button_element") - public val CHOICE_LOCAL_IMAGE_ELEMENT: Choice = Choice(tag - = 2, adapter = LocalImageElement.ADAPTER, declaredName = "local_image_element") + public val CHOICE_LOCAL_IMAGE_ELEMENT: Choice = + Choice(tag = 2, adapter = LocalImageElement.ADAPTER, declaredName = "local_image_element") public val CHOICE_REMOTE_IMAGE_ELEMENT: Choice = - Choice(tag = 3, adapter = RemoteImageElement.ADAPTER, declaredName = - "remote_image_element") + Choice(tag = 3, adapter = RemoteImageElement.ADAPTER, declaredName = "remote_image_element") - public val CHOICE_MONEY_ELEMENT: Choice = Choice(tag = 4, adapter = - MoneyElement.ADAPTER, declaredName = "money_element") + public val CHOICE_MONEY_ELEMENT: Choice = + Choice(tag = 4, adapter = MoneyElement.ADAPTER, declaredName = "money_element") - public val CHOICE_SPACER_ELEMENT: Choice = Choice(tag = 5, adapter - = SpacerElement.ADAPTER, declaredName = "spacer_element") + public val CHOICE_SPACER_ELEMENT: Choice = + Choice(tag = 5, adapter = SpacerElement.ADAPTER, declaredName = "spacer_element") - public val CHOICE_TEXT_ELEMENT: Choice = Choice(tag = 6, adapter = - TextElement.ADAPTER, declaredName = "text_element") + public val CHOICE_TEXT_ELEMENT: Choice = + Choice(tag = 6, adapter = TextElement.ADAPTER, declaredName = "text_element") public val CHOICE_CUSTOMIZED_CARD_ELEMENT: Choice = - Choice(tag = 7, adapter = CustomizedCardElement.ADAPTER, declaredName - = "customized_card_element") + Choice(tag = 7, adapter = CustomizedCardElement.ADAPTER, declaredName = "customized_card_element") - public val CHOICE_ADDRESS_ELEMENT: Choice = Choice(tag = 8, - adapter = AddressElement.ADAPTER, declaredName = "address_element") + public val CHOICE_ADDRESS_ELEMENT: Choice = + Choice(tag = 8, adapter = AddressElement.ADAPTER, declaredName = "address_element") - public val CHOICE_TEXT_INPUT_ELEMENT: Choice = Choice(tag = - 9, adapter = TextInputElement.ADAPTER, declaredName = "text_input_element") + public val CHOICE_TEXT_INPUT_ELEMENT: Choice = + Choice(tag = 9, adapter = TextInputElement.ADAPTER, declaredName = "text_input_element") @Deprecated(message = "option_picker_element is deprecated") public val CHOICE_OPTION_PICKER_ELEMENT: Choice = - Choice(tag = 10, adapter = OptionPickerElement.ADAPTER, declaredName = - "option_picker_element") + Choice(tag = 10, adapter = OptionPickerElement.ADAPTER, declaredName = "option_picker_element") - public val CHOICE_DETAIL_ROW_ELEMENT: Choice = Choice(tag = - 11, adapter = DetailRowElement.ADAPTER, declaredName = "detail_row_element") + public val CHOICE_DETAIL_ROW_ELEMENT: Choice = + Choice(tag = 11, adapter = DetailRowElement.ADAPTER, declaredName = "detail_row_element") public val CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT: Choice = - Choice(tag = 12, adapter = - CurrencyConversionFlagsElement.ADAPTER, declaredName = "currency_conversion_flags_element") + Choice(tag = 12, adapter = CurrencyConversionFlagsElement.ADAPTER, declaredName = "currency_conversion_flags_element") @JvmStatic - public val CHOICE_KEYS: Set> = setOf(CHOICE_BUTTON_ELEMENT, - CHOICE_LOCAL_IMAGE_ELEMENT, CHOICE_REMOTE_IMAGE_ELEMENT, CHOICE_MONEY_ELEMENT, - CHOICE_SPACER_ELEMENT, CHOICE_TEXT_ELEMENT, CHOICE_CUSTOMIZED_CARD_ELEMENT, - CHOICE_ADDRESS_ELEMENT, CHOICE_TEXT_INPUT_ELEMENT, CHOICE_OPTION_PICKER_ELEMENT, - CHOICE_DETAIL_ROW_ELEMENT, CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT) + public val CHOICE_KEYS: Set> = + setOf(CHOICE_BUTTON_ELEMENT, CHOICE_LOCAL_IMAGE_ELEMENT, CHOICE_REMOTE_IMAGE_ELEMENT, CHOICE_MONEY_ELEMENT, CHOICE_SPACER_ELEMENT, CHOICE_TEXT_ELEMENT, CHOICE_CUSTOMIZED_CARD_ELEMENT, CHOICE_ADDRESS_ELEMENT, CHOICE_TEXT_INPUT_ELEMENT, CHOICE_OPTION_PICKER_ELEMENT, CHOICE_DETAIL_ROW_ELEMENT, CHOICE_CURRENCY_CONVERSION_FLAGS_ELEMENT) - public val DECISION_A: Decision = Decision(tag = 101, adapter = - ProtoAdapter.STRING, declaredName = "a") + public val DECISION_A: Decision = + Decision(tag = 101, adapter = ProtoAdapter.STRING, declaredName = "a") - public val DECISION_B: Decision = Decision(tag = 102, adapter = - ProtoAdapter.STRING, declaredName = "b") + public val DECISION_B: Decision = + Decision(tag = 102, adapter = ProtoAdapter.STRING, declaredName = "b") - public val DECISION_C: Decision = Decision(tag = 103, adapter = - ProtoAdapter.STRING, declaredName = "c") + public val DECISION_C: Decision = + Decision(tag = 103, adapter = ProtoAdapter.STRING, declaredName = "c") - public val DECISION_D: Decision = Decision(tag = 104, adapter = - ProtoAdapter.STRING, declaredName = "d") + public val DECISION_D: Decision = + Decision(tag = 104, adapter = ProtoAdapter.STRING, declaredName = "d") - public val DECISION_E: Decision = Decision(tag = 105, adapter = - ProtoAdapter.STRING, declaredName = "e") + public val DECISION_E: Decision = + Decision(tag = 105, adapter = ProtoAdapter.STRING, declaredName = "e") - public val DECISION_F: Decision = Decision(tag = 106, adapter = - ProtoAdapter.STRING, declaredName = "f") + public val DECISION_F: Decision = + Decision(tag = 106, adapter = ProtoAdapter.STRING, declaredName = "f") - public val DECISION_G: Decision = Decision(tag = 107, adapter = - ProtoAdapter.STRING, declaredName = "g") + public val DECISION_G: Decision = + Decision(tag = 107, adapter = ProtoAdapter.STRING, declaredName = "g") - public val DECISION_H: Decision = Decision(tag = 108, adapter = - ProtoAdapter.STRING, declaredName = "h") + public val DECISION_H: Decision = + Decision(tag = 108, adapter = ProtoAdapter.STRING, declaredName = "h") @JvmStatic - public val DECISION_KEYS: Set> = setOf(DECISION_A, DECISION_B, DECISION_C, - DECISION_D, DECISION_E, DECISION_F, DECISION_G, DECISION_H) + public val DECISION_KEYS: Set> = + setOf(DECISION_A, DECISION_B, DECISION_C, DECISION_D, DECISION_E, DECISION_F, DECISION_G, DECISION_H) private const val serialVersionUID: Long = 0L @@ -289,8 +282,7 @@ public class Form( override fun toString(): String = "ButtonElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): ButtonElement = - ButtonElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): ButtonElement = ButtonElement(unknownFields) public class Builder : Message.Builder() { override fun build(): ButtonElement = ButtonElement( @@ -336,8 +328,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): ButtonElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): ButtonElement = Builder().apply(body).build() } } @@ -361,8 +352,7 @@ public class Form( override fun toString(): String = "LocalImageElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): LocalImageElement = - LocalImageElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): LocalImageElement = LocalImageElement(unknownFields) public class Builder : Message.Builder() { override fun build(): LocalImageElement = LocalImageElement( @@ -372,8 +362,8 @@ public class Form( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, LocalImageElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.LocalImageElement", @@ -409,8 +399,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): LocalImageElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): LocalImageElement = Builder().apply(body).build() } } @@ -434,8 +423,7 @@ public class Form( override fun toString(): String = "RemoteImageElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): RemoteImageElement = - RemoteImageElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): RemoteImageElement = RemoteImageElement(unknownFields) public class Builder : Message.Builder() { override fun build(): RemoteImageElement = RemoteImageElement( @@ -445,8 +433,8 @@ public class Form( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, RemoteImageElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.RemoteImageElement", @@ -482,8 +470,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): RemoteImageElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): RemoteImageElement = Builder().apply(body).build() } } @@ -507,8 +494,7 @@ public class Form( override fun toString(): String = "MoneyElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MoneyElement = - MoneyElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MoneyElement = MoneyElement(unknownFields) public class Builder : Message.Builder() { override fun build(): MoneyElement = MoneyElement( @@ -554,8 +540,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): MoneyElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): MoneyElement = Builder().apply(body).build() } } @@ -579,8 +564,7 @@ public class Form( override fun toString(): String = "SpacerElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): SpacerElement = - SpacerElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): SpacerElement = SpacerElement(unknownFields) public class Builder : Message.Builder() { override fun build(): SpacerElement = SpacerElement( @@ -626,8 +610,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): SpacerElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): SpacerElement = Builder().apply(body).build() } } @@ -672,8 +655,7 @@ public class Form( return result.joinToString(prefix = "TextElement{", separator = ", ", postfix = "}") } - public fun copy(text: String? = this.text, unknownFields: ByteString = this.unknownFields): - TextElement = TextElement(text, unknownFields) + public fun copy(text: String? = this.text, unknownFields: ByteString = this.unknownFields): TextElement = TextElement(text, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -762,8 +744,7 @@ public class Form( override fun toString(): String = "CustomizedCardElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): CustomizedCardElement = - CustomizedCardElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): CustomizedCardElement = CustomizedCardElement(unknownFields) public class Builder : Message.Builder() { override fun build(): CustomizedCardElement = CustomizedCardElement( @@ -773,8 +754,8 @@ public class Form( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, CustomizedCardElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.CustomizedCardElement", @@ -810,8 +791,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): CustomizedCardElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): CustomizedCardElement = Builder().apply(body).build() } } @@ -835,8 +815,7 @@ public class Form( override fun toString(): String = "AddressElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): AddressElement = - AddressElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): AddressElement = AddressElement(unknownFields) public class Builder : Message.Builder() { override fun build(): AddressElement = AddressElement( @@ -882,8 +861,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): AddressElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): AddressElement = Builder().apply(body).build() } } @@ -907,8 +885,7 @@ public class Form( override fun toString(): String = "TextInputElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): TextInputElement = - TextInputElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): TextInputElement = TextInputElement(unknownFields) public class Builder : Message.Builder() { override fun build(): TextInputElement = TextInputElement( @@ -954,8 +931,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): TextInputElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): TextInputElement = Builder().apply(body).build() } } @@ -979,8 +955,7 @@ public class Form( override fun toString(): String = "OptionPickerElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): OptionPickerElement = - OptionPickerElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): OptionPickerElement = OptionPickerElement(unknownFields) public class Builder : Message.Builder() { override fun build(): OptionPickerElement = OptionPickerElement( @@ -990,8 +965,8 @@ public class Form( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, OptionPickerElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.OptionPickerElement", @@ -1027,8 +1002,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): OptionPickerElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): OptionPickerElement = Builder().apply(body).build() } } @@ -1052,8 +1026,7 @@ public class Form( override fun toString(): String = "DetailRowElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): DetailRowElement = - DetailRowElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): DetailRowElement = DetailRowElement(unknownFields) public class Builder : Message.Builder() { override fun build(): DetailRowElement = DetailRowElement( @@ -1099,15 +1072,13 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): DetailRowElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): DetailRowElement = Builder().apply(body).build() } } public class CurrencyConversionFlagsElement( unknownFields: ByteString = ByteString.EMPTY, - ) : Message(ADAPTER, - unknownFields) { + ) : Message(ADAPTER, unknownFields) { override fun newBuilder(): Builder { val builder = Builder() builder.addUnknownFields(unknownFields) @@ -1125,8 +1096,7 @@ public class Form( override fun toString(): String = "CurrencyConversionFlagsElement{}" - public fun copy(unknownFields: ByteString = this.unknownFields): CurrencyConversionFlagsElement - = CurrencyConversionFlagsElement(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): CurrencyConversionFlagsElement = CurrencyConversionFlagsElement(unknownFields) public class Builder : Message.Builder() { override fun build(): CurrencyConversionFlagsElement = CurrencyConversionFlagsElement( @@ -1136,8 +1106,8 @@ public class Form( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, CurrencyConversionFlagsElement::class, "type.googleapis.com/squareup.protos.kotlin.oneof.Form.CurrencyConversionFlagsElement", @@ -1165,8 +1135,7 @@ public class Form( ) } - override fun redact(`value`: CurrencyConversionFlagsElement): CurrencyConversionFlagsElement - = value.copy( + override fun redact(`value`: CurrencyConversionFlagsElement): CurrencyConversionFlagsElement = value.copy( unknownFields = ByteString.EMPTY ) } @@ -1174,8 +1143,7 @@ public class Form( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): CurrencyConversionFlagsElement = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): CurrencyConversionFlagsElement = Builder().apply(body).build() } } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt index d867771f5a..1b4e0dc438 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageUsingMultipleEnums.kt @@ -78,8 +78,7 @@ public class MessageUsingMultipleEnums( val result = mutableListOf() if (a != null) result += """a=$a""" if (b != null) result += """b=$b""" - return result.joinToString(prefix = "MessageUsingMultipleEnums{", separator = ", ", postfix = - "}") + return result.joinToString(prefix = "MessageUsingMultipleEnums{", separator = ", ", postfix = "}") } public fun copy( @@ -114,8 +113,8 @@ public class MessageUsingMultipleEnums( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, MessageUsingMultipleEnums::class, "type.googleapis.com/squareup.protos.kotlin.MessageUsingMultipleEnums", @@ -167,8 +166,7 @@ public class MessageUsingMultipleEnums( ) } - override fun redact(`value`: MessageUsingMultipleEnums): MessageUsingMultipleEnums = - value.copy( + override fun redact(`value`: MessageUsingMultipleEnums): MessageUsingMultipleEnums = value.copy( unknownFields = ByteString.EMPTY ) } @@ -176,7 +174,6 @@ public class MessageUsingMultipleEnums( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): MessageUsingMultipleEnums = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): MessageUsingMultipleEnums = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt index 84835b8db5..ecab06cf03 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/MessageWithStatus.kt @@ -48,8 +48,7 @@ public class MessageWithStatus( override fun toString(): String = "MessageWithStatus{}" - public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithStatus = - MessageWithStatus(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): MessageWithStatus = MessageWithStatus(unknownFields) public class Builder : Message.Builder() { override fun build(): MessageWithStatus = MessageWithStatus( @@ -95,8 +94,7 @@ public class MessageWithStatus( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): MessageWithStatus = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): MessageWithStatus = Builder().apply(body).build() } public enum class Status( diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt index c10804b9bf..0600c7aa70 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/NoFields.kt @@ -47,8 +47,7 @@ public class NoFields( override fun toString(): String = "NoFields{}" - public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = - NoFields(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): NoFields = NoFields(unknownFields) public class Builder : Message.Builder() { override fun build(): NoFields = NoFields( diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt index 2cc646318b..b4a886c90b 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/OtherMessageWithStatus.kt @@ -48,8 +48,7 @@ public class OtherMessageWithStatus( override fun toString(): String = "OtherMessageWithStatus{}" - public fun copy(unknownFields: ByteString = this.unknownFields): OtherMessageWithStatus = - OtherMessageWithStatus(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): OtherMessageWithStatus = OtherMessageWithStatus(unknownFields) public class Builder : Message.Builder() { override fun build(): OtherMessageWithStatus = OtherMessageWithStatus( @@ -59,8 +58,8 @@ public class OtherMessageWithStatus( public companion object { @JvmField - public val ADAPTER: ProtoAdapter = object : - ProtoAdapter( + public val ADAPTER: ProtoAdapter = + object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, OtherMessageWithStatus::class, "type.googleapis.com/squareup.protos.kotlin.OtherMessageWithStatus", @@ -96,8 +95,7 @@ public class OtherMessageWithStatus( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): OtherMessageWithStatus = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): OtherMessageWithStatus = Builder().apply(body).build() } public enum class Status( diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Percents.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Percents.kt index f2092b3101..c3d1f0e469 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Percents.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/Percents.kt @@ -47,16 +47,14 @@ public class Percents( schemaIndex = 1, ) @JvmField - public - val very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: + public val very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int? = null, unknownFields: ByteString = ByteString.EMPTY, ) : Message(ADAPTER, unknownFields) { override fun newBuilder(): Builder { val builder = Builder() builder.text = text - builder.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 + builder.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 builder.addUnknownFields(unknownFields) return builder } @@ -66,11 +64,7 @@ public class Percents( if (other !is Percents) return false if (unknownFields != other.unknownFields) return false if (text != other.text) return false - if - (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 - != - other.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) - return false + if (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 != other.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) return false return true } @@ -79,9 +73,7 @@ public class Percents( if (result == 0) { result = unknownFields.hashCode() result = result * 37 + (text?.hashCode() ?: 0) - result = result * 37 + - (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3?.hashCode() - ?: 0) + result = result * 37 + (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3?.hashCode() ?: 0) super.hashCode = result } return result @@ -90,30 +82,22 @@ public class Percents( override fun toString(): String { val result = mutableListOf() if (text != null) result += """text=${sanitize(text)}""" - if - (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 - != null) result += - """very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3=$very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3""" + if (very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 != null) result += """very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3=$very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3""" return result.joinToString(prefix = "Percents{", separator = ", ", postfix = "}") } public fun copy( text: String? = this.text, - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int? - = - this.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, + very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int? = this.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, unknownFields: ByteString = this.unknownFields, - ): Percents = Percents(text, - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, - unknownFields) + ): Percents = Percents(text, very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, unknownFields) public class Builder : Message.Builder() { @JvmField public var text: String? = null @JvmField - public - var very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: + public var very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int? = null /** @@ -127,18 +111,14 @@ public class Percents( /** * Testing very long field name in builders. */ - public - fun very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3(very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int?): - Builder { - this.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 + public fun very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3(very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int?): Builder { + this.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 return this } override fun build(): Percents = Percents( text = text, - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, + very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, unknownFields = buildUnknownFields() ) } @@ -156,44 +136,35 @@ public class Percents( override fun encodedSize(`value`: Percents): Int { var size = value.unknownFields.size size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.text) - size += ProtoAdapter.INT32.encodedSizeWithTag(2, - value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) + size += ProtoAdapter.INT32.encodedSizeWithTag(2, value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) return size } override fun encode(writer: ProtoWriter, `value`: Percents) { ProtoAdapter.STRING.encodeWithTag(writer, 1, value.text) - ProtoAdapter.INT32.encodeWithTag(writer, 2, - value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) + ProtoAdapter.INT32.encodeWithTag(writer, 2, value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) writer.writeBytes(value.unknownFields) } override fun encode(writer: ReverseProtoWriter, `value`: Percents) { writer.writeBytes(value.unknownFields) - ProtoAdapter.INT32.encodeWithTag(writer, 2, - value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) + ProtoAdapter.INT32.encodeWithTag(writer, 2, value.very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3) ProtoAdapter.STRING.encodeWithTag(writer, 1, value.text) } override fun decode(reader: ProtoReader): Percents { var text: String? = null - var - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: - Int? = null + var very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3: Int? = null val unknownFields = reader.forEachTag { tag -> when (tag) { 1 -> text = ProtoAdapter.STRING.decode(reader) - 2 -> - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = - ProtoAdapter.INT32.decode(reader) + 2 -> very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = ProtoAdapter.INT32.decode(reader) else -> reader.readUnknownField(tag) } } return Percents( text = text, - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 - = - very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, + very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3 = very_very_long_field_name_placeholder_1_with_very_long_same_placeholder_2_and_different_placeholder_3, unknownFields = unknownFields ) } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt index ce617fa55d..b9452bd0b4 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt @@ -925,8 +925,8 @@ public class AllTypes( schemaIndex = 50, ) @JvmField - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 301, @@ -1052,8 +1052,8 @@ public class AllTypes( schemaIndex = 64, ) @JvmField - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 501, @@ -1071,8 +1071,8 @@ public class AllTypes( schemaIndex = 82, ) @JvmField - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -1081,8 +1081,8 @@ public class AllTypes( schemaIndex = 83, ) @JvmField - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -1091,8 +1091,8 @@ public class AllTypes( schemaIndex = 84, ) @JvmField - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) /** * Extension source: all_types.proto @@ -1284,8 +1284,8 @@ public class AllTypes( schemaIndex = 129, ) @JvmField - public val ext_rep_nested_enum: List = immutableCopyOf("ext_rep_nested_enum", - ext_rep_nested_enum) + public val ext_rep_nested_enum: List = + immutableCopyOf("ext_rep_nested_enum", ext_rep_nested_enum) /** * Extension source: all_types.proto @@ -1297,8 +1297,8 @@ public class AllTypes( schemaIndex = 130, ) @JvmField - public val ext_rep_nested_message: List = immutableCopyOf("ext_rep_nested_message", - ext_rep_nested_message) + public val ext_rep_nested_message: List = + immutableCopyOf("ext_rep_nested_message", ext_rep_nested_message) /** * Extension source: all_types.proto @@ -1466,8 +1466,8 @@ public class AllTypes( schemaIndex = 144, ) @JvmField - public val ext_pack_nested_enum: List = immutableCopyOf("ext_pack_nested_enum", - ext_pack_nested_enum) + public val ext_pack_nested_enum: List = + immutableCopyOf("ext_pack_nested_enum", ext_pack_nested_enum) override fun newBuilder(): Builder { val builder = Builder() @@ -2017,14 +2017,12 @@ public class AllTypes( if (array_uint32.isNotEmpty()) result += """array_uint32=${array_uint32.contentToString()}""" if (array_sint32.isNotEmpty()) result += """array_sint32=${array_sint32.contentToString()}""" if (array_fixed32.isNotEmpty()) result += """array_fixed32=${array_fixed32.contentToString()}""" - if (array_sfixed32.isNotEmpty()) result += - """array_sfixed32=${array_sfixed32.contentToString()}""" + if (array_sfixed32.isNotEmpty()) result += """array_sfixed32=${array_sfixed32.contentToString()}""" if (array_int64.isNotEmpty()) result += """array_int64=${array_int64.contentToString()}""" if (array_uint64.isNotEmpty()) result += """array_uint64=${array_uint64.contentToString()}""" if (array_sint64.isNotEmpty()) result += """array_sint64=${array_sint64.contentToString()}""" if (array_fixed64.isNotEmpty()) result += """array_fixed64=${array_fixed64.contentToString()}""" - if (array_sfixed64.isNotEmpty()) result += - """array_sfixed64=${array_sfixed64.contentToString()}""" + if (array_sfixed64.isNotEmpty()) result += """array_sfixed64=${array_sfixed64.contentToString()}""" if (array_float.isNotEmpty()) result += """array_float=${array_float.contentToString()}""" if (array_double.isNotEmpty()) result += """array_double=${array_double.contentToString()}""" if (ext_opt_int32 != null) result += """ext_opt_int32=$ext_opt_int32""" @@ -2043,8 +2041,7 @@ public class AllTypes( if (ext_opt_string != null) result += """ext_opt_string=${sanitize(ext_opt_string)}""" if (ext_opt_bytes != null) result += """ext_opt_bytes=$ext_opt_bytes""" if (ext_opt_nested_enum != null) result += """ext_opt_nested_enum=$ext_opt_nested_enum""" - if (ext_opt_nested_message != null) result += - """ext_opt_nested_message=$ext_opt_nested_message""" + if (ext_opt_nested_message != null) result += """ext_opt_nested_message=$ext_opt_nested_message""" if (ext_rep_int32.isNotEmpty()) result += """ext_rep_int32=$ext_rep_int32""" if (ext_rep_uint32.isNotEmpty()) result += """ext_rep_uint32=$ext_rep_uint32""" if (ext_rep_sint32.isNotEmpty()) result += """ext_rep_sint32=$ext_rep_sint32""" @@ -2061,8 +2058,7 @@ public class AllTypes( if (ext_rep_string.isNotEmpty()) result += """ext_rep_string=${sanitize(ext_rep_string)}""" if (ext_rep_bytes.isNotEmpty()) result += """ext_rep_bytes=$ext_rep_bytes""" if (ext_rep_nested_enum.isNotEmpty()) result += """ext_rep_nested_enum=$ext_rep_nested_enum""" - if (ext_rep_nested_message.isNotEmpty()) result += - """ext_rep_nested_message=$ext_rep_nested_message""" + if (ext_rep_nested_message.isNotEmpty()) result += """ext_rep_nested_message=$ext_rep_nested_message""" if (ext_pack_int32.isNotEmpty()) result += """ext_pack_int32=$ext_pack_int32""" if (ext_pack_uint32.isNotEmpty()) result += """ext_pack_uint32=$ext_pack_uint32""" if (ext_pack_sint32.isNotEmpty()) result += """ext_pack_sint32=$ext_pack_sint32""" @@ -2076,8 +2072,7 @@ public class AllTypes( if (ext_pack_bool.isNotEmpty()) result += """ext_pack_bool=$ext_pack_bool""" if (ext_pack_float.isNotEmpty()) result += """ext_pack_float=$ext_pack_float""" if (ext_pack_double.isNotEmpty()) result += """ext_pack_double=$ext_pack_double""" - if (ext_pack_nested_enum.isNotEmpty()) result += - """ext_pack_nested_enum=$ext_pack_nested_enum""" + if (ext_pack_nested_enum.isNotEmpty()) result += """ext_pack_nested_enum=$ext_pack_nested_enum""" return result.joinToString(prefix = "AllTypes{", separator = ", ", postfix = "}") } @@ -2228,31 +2223,7 @@ public class AllTypes( ext_pack_double: List = this.ext_pack_double, ext_pack_nested_enum: List = this.ext_pack_nested_enum, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, - opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, - opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, - req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, - req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, - rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, - rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, - rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, - pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, - pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, - default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, - default_fixed64, default_sfixed64, default_bool, default_float, default_double, - default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, - map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, - array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, - array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, - ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, - ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, - ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, - ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, - ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, - ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, - ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, - ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, - ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) + ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, default_fixed64, default_sfixed64, default_bool, default_float, default_double, default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -3510,10 +3481,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -3676,17 +3645,17 @@ public class AllTypes( null, "all_types.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -3820,8 +3789,7 @@ public class AllTypes( size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1_114, value.ext_rep_string) size += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(1_115, value.ext_rep_bytes) size += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(1_116, value.ext_rep_nested_enum) - size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, - value.ext_rep_nested_message) + size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, value.ext_rep_nested_message) size += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(1_201, value.ext_pack_int32) size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(1_202, value.ext_pack_uint32) size += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(1_203, value.ext_pack_sint32) @@ -3970,8 +3938,7 @@ public class AllTypes( ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) @@ -4005,8 +3972,7 @@ public class AllTypes( ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) @@ -4794,10 +4760,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -4997,8 +4961,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -5063,8 +5026,7 @@ public class AllTypes( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt index 57ee9c040d..7e7729afdf 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/foreign/ForeignMessage.kt @@ -165,7 +165,6 @@ public class ForeignMessage( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): ForeignMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): ForeignMessage = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt index 53a9ca4b47..b1eb39263a 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Mappy.kt @@ -74,8 +74,7 @@ public class Mappy( return result.joinToString(prefix = "Mappy{", separator = ", ", postfix = "}") } - public fun copy(things: Map = this.things, unknownFields: ByteString = - this.unknownFields): Mappy = Mappy(things, unknownFields) + public fun copy(things: Map = this.things, unknownFields: ByteString = this.unknownFields): Mappy = Mappy(things, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -102,8 +101,8 @@ public class Mappy( null, "map.proto" ) { - private val thingsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, Thing.ADAPTER) } + private val thingsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, Thing.ADAPTER) } override fun encodedSize(`value`: Mappy): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt index 07b9a5e089..31a2dcad27 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/MappyTwo.kt @@ -179,17 +179,17 @@ public class MappyTwo( null, "map.proto" ) { - private val string_enumsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ValueEnum.ADAPTER) } + private val string_enumsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ValueEnum.ADAPTER) } - private val int_thingsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, Thing.ADAPTER) } + private val int_thingsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT64, Thing.ADAPTER) } - private val string_intsAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.SINT64) } + private val string_intsAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.SINT64) } - private val int_things_twoAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, Thing.ADAPTER) } + private val int_things_twoAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.SINT32, Thing.ADAPTER) } override fun encodedSize(`value`: MappyTwo): Int { var size = value.unknownFields.size diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt index 85ffab715b..afc7d8628a 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/map/Thing.kt @@ -68,8 +68,7 @@ public class Thing( return result.joinToString(prefix = "Thing{", separator = ", ", postfix = "}") } - public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing - = Thing(name, unknownFields) + public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing = Thing(name, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Repeated.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Repeated.kt index 32c4a43399..b81f1239d6 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Repeated.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Repeated.kt @@ -74,8 +74,7 @@ public class Repeated( return result.joinToString(prefix = "Repeated{", separator = ", ", postfix = "}") } - public fun copy(things: List = this.things, unknownFields: ByteString = - this.unknownFields): Repeated = Repeated(things, unknownFields) + public fun copy(things: List = this.things, unknownFields: ByteString = this.unknownFields): Repeated = Repeated(things, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Thing.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Thing.kt index b3134ca087..a1129acbc0 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Thing.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/repeated/Thing.kt @@ -68,8 +68,7 @@ public class Thing( return result.joinToString(prefix = "Thing{", separator = ", ", postfix = "}") } - public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing - = Thing(name, unknownFields) + public fun copy(name: String? = this.name, unknownFields: ByteString = this.unknownFields): Thing = Thing(name, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/GrpcNoPackageServiceClient.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/GrpcNoPackageServiceClient.kt index 50ea601d67..8adf28f745 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/GrpcNoPackageServiceClient.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/GrpcNoPackageServiceClient.kt @@ -15,8 +15,7 @@ import kotlin.Suppress public class GrpcNoPackageServiceClient( private val client: GrpcClient, ) : NoPackageServiceClient { - override fun NoPackageMethod(): GrpcCall = - client.newCall(GrpcMethod( + override fun NoPackageMethod(): GrpcCall = client.newCall(GrpcMethod( path = "/NoPackageService/NoPackageMethod", requestAdapter = NoPackageRequest.ADAPTER, responseAdapter = NoPackageResponse.ADAPTER diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageRequest.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageRequest.kt index 9e36a84146..b72ae25d04 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageRequest.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageRequest.kt @@ -34,8 +34,7 @@ public class NoPackageRequest( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -48,8 +47,7 @@ public class NoPackageRequest( override fun toString(): String = "NoPackageRequest{}" - public fun copy(unknownFields: ByteString = this.unknownFields): NoPackageRequest = - NoPackageRequest(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): NoPackageRequest = NoPackageRequest(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageResponse.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageResponse.kt index 40cf389193..b25c9746c6 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageResponse.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/NoPackageResponse.kt @@ -34,8 +34,7 @@ public class NoPackageResponse( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -48,8 +47,7 @@ public class NoPackageResponse( override fun toString(): String = "NoPackageResponse{}" - public fun copy(unknownFields: ByteString = this.unknownFields): NoPackageResponse = - NoPackageResponse(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): NoPackageResponse = NoPackageResponse(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeRequest.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeRequest.kt index 8eae725b19..f5776ca74f 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeRequest.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeRequest.kt @@ -34,8 +34,7 @@ public class SomeRequest( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -48,8 +47,7 @@ public class SomeRequest( override fun toString(): String = "SomeRequest{}" - public fun copy(unknownFields: ByteString = this.unknownFields): SomeRequest = - SomeRequest(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): SomeRequest = SomeRequest(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeResponse.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeResponse.kt index 2f2b94d73f..ba64bf0f47 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeResponse.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/services/SomeResponse.kt @@ -34,8 +34,7 @@ public class SomeResponse( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -48,8 +47,7 @@ public class SomeResponse( override fun toString(): String = "SomeResponse{}" - public fun copy(unknownFields: ByteString = this.unknownFields): SomeResponse = - SomeResponse(unknownFields) + public fun copy(unknownFields: ByteString = this.unknownFields): SomeResponse = SomeResponse(unknownFields) public companion object { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt index 9f10458de0..b2db70efef 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/ExternalMessage.kt @@ -152,8 +152,7 @@ public class ExternalMessage( nested_message_ext: SimpleMessage.NestedMessage? = this.nested_message_ext, nested_enum_ext: SimpleMessage.NestedEnum? = this.nested_enum_ext, unknownFields: ByteString = this.unknownFields, - ): ExternalMessage = ExternalMessage(f, fooext, barext, bazext, nested_message_ext, - nested_enum_ext, unknownFields) + ): ExternalMessage = ExternalMessage(f, fooext, barext, bazext, nested_message_ext, nested_enum_ext, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -234,8 +233,7 @@ public class ExternalMessage( size += ProtoAdapter.INT32.asRepeated().encodedSizeWithTag(125, value.fooext) size += ProtoAdapter.INT32.encodedSizeWithTag(126, value.barext) size += ProtoAdapter.INT32.encodedSizeWithTag(127, value.bazext) - size += SimpleMessage.NestedMessage.ADAPTER.encodedSizeWithTag(128, - value.nested_message_ext) + size += SimpleMessage.NestedMessage.ADAPTER.encodedSizeWithTag(128, value.nested_message_ext) size += SimpleMessage.NestedEnum.ADAPTER.encodedSizeWithTag(129, value.nested_enum_ext) return size } @@ -294,8 +292,7 @@ public class ExternalMessage( } override fun redact(`value`: ExternalMessage): ExternalMessage = value.copy( - nested_message_ext = - value.nested_message_ext?.let(SimpleMessage.NestedMessage.ADAPTER::redact), + nested_message_ext = value.nested_message_ext?.let(SimpleMessage.NestedMessage.ADAPTER::redact), unknownFields = ByteString.EMPTY ) } @@ -303,7 +300,6 @@ public class ExternalMessage( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): ExternalMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): ExternalMessage = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt index 1792558212..88a52fe185 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/simple/SimpleMessage.kt @@ -234,8 +234,7 @@ public class SimpleMessage( result_ += """required_int32=$required_int32""" if (repeated_double.isNotEmpty()) result_ += """repeated_double=$repeated_double""" if (default_foreign_enum != null) result_ += """default_foreign_enum=$default_foreign_enum""" - if (no_default_foreign_enum != null) result_ += - """no_default_foreign_enum=$no_default_foreign_enum""" + if (no_default_foreign_enum != null) result_ += """no_default_foreign_enum=$no_default_foreign_enum""" if (package_ != null) result_ += """package_=${sanitize(package_)}""" if (result != null) result_ += """result=${sanitize(result)}""" if (other != null) result_ += """other=${sanitize(other)}""" @@ -257,9 +256,7 @@ public class SimpleMessage( other: String? = this.other, o: String? = this.o, unknownFields: ByteString = this.unknownFields, - ): SimpleMessage = SimpleMessage(optional_int32, optional_nested_msg, optional_external_msg, - default_nested_enum, required_int32, repeated_double, default_foreign_enum, - no_default_foreign_enum, package_, result, other, o, unknownFields) + ): SimpleMessage = SimpleMessage(optional_int32, optional_nested_msg, optional_external_msg, default_nested_enum, required_int32, repeated_double, default_foreign_enum, no_default_foreign_enum, package_, result, other, o, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -399,8 +396,7 @@ public class SimpleMessage( optional_nested_msg = optional_nested_msg, optional_external_msg = optional_external_msg, default_nested_enum = default_nested_enum, - required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, - "required_int32"), + required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, "required_int32"), repeated_double = repeated_double, default_foreign_enum = default_foreign_enum, no_default_foreign_enum = no_default_foreign_enum, @@ -528,8 +524,7 @@ public class SimpleMessage( optional_nested_msg = optional_nested_msg, optional_external_msg = optional_external_msg, default_nested_enum = default_nested_enum, - required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, - "required_int32"), + required_int32 = required_int32 ?: throw missingRequiredFields(required_int32, "required_int32"), repeated_double = repeated_double, default_foreign_enum = default_foreign_enum, no_default_foreign_enum = no_default_foreign_enum, @@ -598,8 +593,7 @@ public class SimpleMessage( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(bb: Int? = this.bb, unknownFields: ByteString = this.unknownFields): - NestedMessage = NestedMessage(bb, unknownFields) + public fun copy(bb: Int? = this.bb, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(bb, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -667,8 +661,7 @@ public class SimpleMessage( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedMessage = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt index 14d7a8e493..2e555b6e95 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionOne.kt @@ -67,8 +67,7 @@ public class NestedVersionOne( return result.joinToString(prefix = "NestedVersionOne{", separator = ", ", postfix = "}") } - public fun copy(i: Int? = this.i, unknownFields: ByteString = this.unknownFields): - NestedVersionOne = NestedVersionOne(i, unknownFields) + public fun copy(i: Int? = this.i, unknownFields: ByteString = this.unknownFields): NestedVersionOne = NestedVersionOne(i, unknownFields) public class Builder : Message.Builder() { @JvmField @@ -133,7 +132,6 @@ public class NestedVersionOne( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedVersionOne = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedVersionOne = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt index 51e1500731..9e217a46da 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/com/squareup/wire/protos/kotlin/unknownfields/NestedVersionTwo.kt @@ -278,7 +278,6 @@ public class NestedVersionTwo( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): NestedVersionTwo = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): NestedVersionTwo = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/Easter.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/Easter.kt index 248d2c66e2..8043dbd9bb 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/Easter.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/Easter.kt @@ -69,8 +69,8 @@ public class Easter( schemaIndex = 3, ) @JvmField - public val easter_animals_packed: List = immutableCopyOf("easter_animals_packed", - easter_animals_packed) + public val easter_animals_packed: List = + immutableCopyOf("easter_animals_packed", easter_animals_packed) override fun newBuilder(): Builder { val builder = Builder() @@ -108,12 +108,10 @@ public class Easter( override fun toString(): String { val result = mutableListOf() - if (optional_easter_animal != null) result += - """optional_easter_animal=$optional_easter_animal""" + if (optional_easter_animal != null) result += """optional_easter_animal=$optional_easter_animal""" result += """identity_easter_animal=$identity_easter_animal""" if (easter_animals.isNotEmpty()) result += """easter_animals=$easter_animals""" - if (easter_animals_packed.isNotEmpty()) result += - """easter_animals_packed=$easter_animals_packed""" + if (easter_animals_packed.isNotEmpty()) result += """easter_animals_packed=$easter_animals_packed""" return result.joinToString(prefix = "Easter{", separator = ", ", postfix = "}") } @@ -123,8 +121,7 @@ public class Easter( easter_animals: List = this.easter_animals, easter_animals_packed: List = this.easter_animals_packed, unknownFields: ByteString = this.unknownFields, - ): Easter = Easter(optional_easter_animal, identity_easter_animal, easter_animals, - easter_animals_packed, unknownFields) + ): Easter = Easter(optional_easter_animal, identity_easter_animal, easter_animals, easter_animals_packed, unknownFields) public class Builder : Message.Builder() { @JvmField diff --git a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt index c0629d87d4..e847c927f7 100644 --- a/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt +++ b/wire-tests/src/jvmKotlinInteropTest/proto-kotlin/squareup/protos/packed_encoding/EmbeddedMessage.kt @@ -47,8 +47,8 @@ public class EmbeddedMessage( schemaIndex = 0, ) @JvmField - public val inner_repeated_number: List = immutableCopyOf("inner_repeated_number", - inner_repeated_number) + public val inner_repeated_number: List = + immutableCopyOf("inner_repeated_number", inner_repeated_number) override fun newBuilder(): Builder { val builder = Builder() @@ -80,8 +80,7 @@ public class EmbeddedMessage( override fun toString(): String { val result = mutableListOf() - if (inner_repeated_number.isNotEmpty()) result += - """inner_repeated_number=$inner_repeated_number""" + if (inner_repeated_number.isNotEmpty()) result += """inner_repeated_number=$inner_repeated_number""" if (inner_number_after != null) result += """inner_number_after=$inner_number_after""" return result.joinToString(prefix = "EmbeddedMessage{", separator = ", ", postfix = "}") } @@ -180,7 +179,6 @@ public class EmbeddedMessage( private const val serialVersionUID: Long = 0L @JvmSynthetic - public inline fun build(body: Builder.() -> Unit): EmbeddedMessage = - Builder().apply(body).build() + public inline fun build(body: Builder.() -> Unit): EmbeddedMessage = Builder().apply(body).build() } } diff --git a/wire-tests/src/jvmKotlinProtoReader32Test/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt b/wire-tests/src/jvmKotlinProtoReader32Test/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt index db6ec82b29..b4e0b90bb8 100644 --- a/wire-tests/src/jvmKotlinProtoReader32Test/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt +++ b/wire-tests/src/jvmKotlinProtoReader32Test/proto-kotlin/com/squareup/wire/protos/kotlin/alltypes/AllTypes.kt @@ -832,8 +832,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 50, ) - public val rep_nested_message: List = immutableCopyOf("rep_nested_message", - rep_nested_message) + public val rep_nested_message: List = + immutableCopyOf("rep_nested_message", rep_nested_message) @field:WireField( tag = 301, @@ -945,8 +945,8 @@ public class AllTypes( label = WireField.Label.PACKED, schemaIndex = 64, ) - public val pack_nested_enum: List = immutableCopyOf("pack_nested_enum", - pack_nested_enum) + public val pack_nested_enum: List = + immutableCopyOf("pack_nested_enum", pack_nested_enum) @field:WireField( tag = 501, @@ -962,8 +962,8 @@ public class AllTypes( adapter = "com.squareup.wire.ProtoAdapter#STRING", schemaIndex = 82, ) - public val map_string_string: Map = immutableCopyOf("map_string_string", - map_string_string) + public val map_string_string: Map = + immutableCopyOf("map_string_string", map_string_string) @field:WireField( tag = 503, @@ -971,8 +971,8 @@ public class AllTypes( adapter = "com.squareup.wire.protos.kotlin.alltypes.AllTypes${'$'}NestedMessage#ADAPTER", schemaIndex = 83, ) - public val map_string_message: Map = immutableCopyOf("map_string_message", - map_string_message) + public val map_string_message: Map = + immutableCopyOf("map_string_message", map_string_message) @field:WireField( tag = 504, @@ -980,8 +980,8 @@ public class AllTypes( adapter = "com.squareup.wire.protos.kotlin.alltypes.AllTypes${'$'}NestedEnum#ADAPTER", schemaIndex = 84, ) - public val map_string_enum: Map = immutableCopyOf("map_string_enum", - map_string_enum) + public val map_string_enum: Map = + immutableCopyOf("map_string_enum", map_string_enum) /** * Extension source: all_types.proto @@ -1157,8 +1157,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 129, ) - public val ext_rep_nested_enum: List = immutableCopyOf("ext_rep_nested_enum", - ext_rep_nested_enum) + public val ext_rep_nested_enum: List = + immutableCopyOf("ext_rep_nested_enum", ext_rep_nested_enum) /** * Extension source: all_types.proto @@ -1169,8 +1169,8 @@ public class AllTypes( label = WireField.Label.REPEATED, schemaIndex = 130, ) - public val ext_rep_nested_message: List = immutableCopyOf("ext_rep_nested_message", - ext_rep_nested_message) + public val ext_rep_nested_message: List = + immutableCopyOf("ext_rep_nested_message", ext_rep_nested_message) /** * Extension source: all_types.proto @@ -1324,15 +1324,14 @@ public class AllTypes( label = WireField.Label.PACKED, schemaIndex = 144, ) - public val ext_pack_nested_enum: List = immutableCopyOf("ext_pack_nested_enum", - ext_pack_nested_enum) + public val ext_pack_nested_enum: List = + immutableCopyOf("ext_pack_nested_enum", ext_pack_nested_enum) @Deprecated( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -1731,14 +1730,12 @@ public class AllTypes( if (array_uint32.isNotEmpty()) result += """array_uint32=${array_uint32.contentToString()}""" if (array_sint32.isNotEmpty()) result += """array_sint32=${array_sint32.contentToString()}""" if (array_fixed32.isNotEmpty()) result += """array_fixed32=${array_fixed32.contentToString()}""" - if (array_sfixed32.isNotEmpty()) result += - """array_sfixed32=${array_sfixed32.contentToString()}""" + if (array_sfixed32.isNotEmpty()) result += """array_sfixed32=${array_sfixed32.contentToString()}""" if (array_int64.isNotEmpty()) result += """array_int64=${array_int64.contentToString()}""" if (array_uint64.isNotEmpty()) result += """array_uint64=${array_uint64.contentToString()}""" if (array_sint64.isNotEmpty()) result += """array_sint64=${array_sint64.contentToString()}""" if (array_fixed64.isNotEmpty()) result += """array_fixed64=${array_fixed64.contentToString()}""" - if (array_sfixed64.isNotEmpty()) result += - """array_sfixed64=${array_sfixed64.contentToString()}""" + if (array_sfixed64.isNotEmpty()) result += """array_sfixed64=${array_sfixed64.contentToString()}""" if (array_float.isNotEmpty()) result += """array_float=${array_float.contentToString()}""" if (array_double.isNotEmpty()) result += """array_double=${array_double.contentToString()}""" if (ext_opt_int32 != null) result += """ext_opt_int32=$ext_opt_int32""" @@ -1757,8 +1754,7 @@ public class AllTypes( if (ext_opt_string != null) result += """ext_opt_string=${sanitize(ext_opt_string)}""" if (ext_opt_bytes != null) result += """ext_opt_bytes=$ext_opt_bytes""" if (ext_opt_nested_enum != null) result += """ext_opt_nested_enum=$ext_opt_nested_enum""" - if (ext_opt_nested_message != null) result += - """ext_opt_nested_message=$ext_opt_nested_message""" + if (ext_opt_nested_message != null) result += """ext_opt_nested_message=$ext_opt_nested_message""" if (ext_rep_int32.isNotEmpty()) result += """ext_rep_int32=$ext_rep_int32""" if (ext_rep_uint32.isNotEmpty()) result += """ext_rep_uint32=$ext_rep_uint32""" if (ext_rep_sint32.isNotEmpty()) result += """ext_rep_sint32=$ext_rep_sint32""" @@ -1775,8 +1771,7 @@ public class AllTypes( if (ext_rep_string.isNotEmpty()) result += """ext_rep_string=${sanitize(ext_rep_string)}""" if (ext_rep_bytes.isNotEmpty()) result += """ext_rep_bytes=$ext_rep_bytes""" if (ext_rep_nested_enum.isNotEmpty()) result += """ext_rep_nested_enum=$ext_rep_nested_enum""" - if (ext_rep_nested_message.isNotEmpty()) result += - """ext_rep_nested_message=$ext_rep_nested_message""" + if (ext_rep_nested_message.isNotEmpty()) result += """ext_rep_nested_message=$ext_rep_nested_message""" if (ext_pack_int32.isNotEmpty()) result += """ext_pack_int32=$ext_pack_int32""" if (ext_pack_uint32.isNotEmpty()) result += """ext_pack_uint32=$ext_pack_uint32""" if (ext_pack_sint32.isNotEmpty()) result += """ext_pack_sint32=$ext_pack_sint32""" @@ -1790,8 +1785,7 @@ public class AllTypes( if (ext_pack_bool.isNotEmpty()) result += """ext_pack_bool=$ext_pack_bool""" if (ext_pack_float.isNotEmpty()) result += """ext_pack_float=$ext_pack_float""" if (ext_pack_double.isNotEmpty()) result += """ext_pack_double=$ext_pack_double""" - if (ext_pack_nested_enum.isNotEmpty()) result += - """ext_pack_nested_enum=$ext_pack_nested_enum""" + if (ext_pack_nested_enum.isNotEmpty()) result += """ext_pack_nested_enum=$ext_pack_nested_enum""" return result.joinToString(prefix = "AllTypes{", separator = ", ", postfix = "}") } @@ -1942,31 +1936,7 @@ public class AllTypes( ext_pack_double: List = this.ext_pack_double, ext_pack_nested_enum: List = this.ext_pack_nested_enum, unknownFields: ByteString = this.unknownFields, - ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, - opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, - opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, - req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, - req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, - rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, - rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, - rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, - pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, - pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, - default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, - default_fixed64, default_sfixed64, default_bool, default_float, default_double, - default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, - map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, - array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, - array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, - ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, - ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, - ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, - ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, - ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, - ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, - ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, - ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, - ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) + ): AllTypes = AllTypes(opt_int32, opt_uint32, opt_sint32, opt_fixed32, opt_sfixed32, opt_int64, opt_uint64, opt_sint64, opt_fixed64, opt_sfixed64, opt_bool, opt_float, opt_double, opt_string, opt_bytes, opt_nested_enum, opt_nested_message, req_int32, req_uint32, req_sint32, req_fixed32, req_sfixed32, req_int64, req_uint64, req_sint64, req_fixed64, req_sfixed64, req_bool, req_float, req_double, req_string, req_bytes, req_nested_enum, req_nested_message, rep_int32, rep_uint32, rep_sint32, rep_fixed32, rep_sfixed32, rep_int64, rep_uint64, rep_sint64, rep_fixed64, rep_sfixed64, rep_bool, rep_float, rep_double, rep_string, rep_bytes, rep_nested_enum, rep_nested_message, pack_int32, pack_uint32, pack_sint32, pack_fixed32, pack_sfixed32, pack_int64, pack_uint64, pack_sint64, pack_fixed64, pack_sfixed64, pack_bool, pack_float, pack_double, pack_nested_enum, default_int32, default_uint32, default_sint32, default_fixed32, default_sfixed32, default_int64, default_uint64, default_sint64, default_fixed64, default_sfixed64, default_bool, default_float, default_double, default_string, default_bytes, default_nested_enum, map_int32_int32, map_string_string, map_string_message, map_string_enum, array_int32, array_uint32, array_sint32, array_fixed32, array_sfixed32, array_int64, array_uint64, array_sint64, array_fixed64, array_sfixed64, array_float, array_double, ext_opt_int32, ext_opt_uint32, ext_opt_sint32, ext_opt_fixed32, ext_opt_sfixed32, ext_opt_int64, ext_opt_uint64, ext_opt_sint64, ext_opt_fixed64, ext_opt_sfixed64, ext_opt_bool, ext_opt_float, ext_opt_double, ext_opt_string, ext_opt_bytes, ext_opt_nested_enum, ext_opt_nested_message, ext_rep_int32, ext_rep_uint32, ext_rep_sint32, ext_rep_fixed32, ext_rep_sfixed32, ext_rep_int64, ext_rep_uint64, ext_rep_sint64, ext_rep_fixed64, ext_rep_sfixed64, ext_rep_bool, ext_rep_float, ext_rep_double, ext_rep_string, ext_rep_bytes, ext_rep_nested_enum, ext_rep_nested_message, ext_pack_int32, ext_pack_uint32, ext_pack_sint32, ext_pack_fixed32, ext_pack_sfixed32, ext_pack_int64, ext_pack_uint64, ext_pack_sint64, ext_pack_fixed64, ext_pack_sfixed64, ext_pack_bool, ext_pack_float, ext_pack_double, ext_pack_nested_enum, unknownFields) public companion object { public const val DEFAULT_DEFAULT_INT32: Int = Int.MAX_VALUE @@ -2015,17 +1985,17 @@ public class AllTypes( null, "all_types.proto" ) { - private val map_int32_int32Adapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } + private val map_int32_int32Adapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32) } - private val map_string_stringAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } + private val map_string_stringAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) } - private val map_string_messageAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } + private val map_string_messageAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER) } - private val map_string_enumAdapter: ProtoAdapter> by lazy { - ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } + private val map_string_enumAdapter: ProtoAdapter> by + lazy { ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER) } override fun encodedSize(`value`: AllTypes): Int { var size = value.unknownFields.size @@ -2159,8 +2129,7 @@ public class AllTypes( size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1_114, value.ext_rep_string) size += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(1_115, value.ext_rep_bytes) size += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(1_116, value.ext_rep_nested_enum) - size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, - value.ext_rep_nested_message) + size += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(1_117, value.ext_rep_nested_message) size += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(1_201, value.ext_pack_int32) size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(1_202, value.ext_pack_uint32) size += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(1_203, value.ext_pack_sint32) @@ -2309,8 +2278,7 @@ public class AllTypes( ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) @@ -2344,8 +2312,7 @@ public class AllTypes( ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 1_203, value.ext_pack_sint32) ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 1_202, value.ext_pack_uint32) ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 1_201, value.ext_pack_int32) - NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, - value.ext_rep_nested_message) + NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 1_117, value.ext_rep_nested_message) NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 1_116, value.ext_rep_nested_enum) ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 1_115, value.ext_rep_bytes) ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1_114, value.ext_rep_string) @@ -3133,10 +3100,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -3855,10 +3820,8 @@ public class AllTypes( req_double = req_double ?: throw missingRequiredFields(req_double, "req_double"), req_string = req_string ?: throw missingRequiredFields(req_string, "req_string"), req_bytes = req_bytes ?: throw missingRequiredFields(req_bytes, "req_bytes"), - req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, - "req_nested_enum"), - req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, - "req_nested_message"), + req_nested_enum = req_nested_enum ?: throw missingRequiredFields(req_nested_enum, "req_nested_enum"), + req_nested_message = req_nested_message ?: throw missingRequiredFields(req_nested_message, "req_nested_message"), rep_int32 = rep_int32, rep_uint32 = rep_uint32, rep_sint32 = rep_sint32, @@ -4027,8 +3990,7 @@ public class AllTypes( message = "Shouldn't be used in Kotlin", level = DeprecationLevel.HIDDEN, ) - override fun newBuilder(): Nothing = throw - AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") + override fun newBuilder(): Nothing = throw AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin") override fun equals(other: Any?): Boolean { if (other === this) return true @@ -4054,8 +4016,7 @@ public class AllTypes( return result.joinToString(prefix = "NestedMessage{", separator = ", ", postfix = "}") } - public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage - = NestedMessage(a, unknownFields) + public fun copy(a: Int? = this.a, unknownFields: ByteString = this.unknownFields): NestedMessage = NestedMessage(a, unknownFields) public companion object { @JvmField