From 19a10f59bc55f317d412899ab193fc5bf3b93bb1 Mon Sep 17 00:00:00 2001 From: Nadav Samet Date: Sun, 10 Dec 2017 07:03:03 -0800 Subject: [PATCH] Introduce toProtoString to returns the ASCII format, instead of toString To keep the original behavior where toString returns the ASCII format, use scalapb.gen(asciiFormatToString=true) if using sbt-protoc, or pass the generator parameter `ascii_format_to_string` if using ScalaPBC. Fix #235 --- CHANGELOG.md | 3 +++ .../scala/scalapb/compiler/ProtobufGenerator.scala | 11 +++++++---- compiler-plugin/src/main/scala/scalapb/package.scala | 7 +++++-- e2e/src/test/scala/CollectionTypesSpec.scala | 2 +- e2e/src/test/scala/EnumSpec.scala | 2 +- e2e/src/test/scala/MapsSpec.scala | 4 ++-- e2e/src/test/scala/RepeatablesSpec.scala | 2 +- e2e/src/test/scala/scalapb/TextFormatSpec.scala | 6 +++--- proptest/src/test/scala/GeneratedCodeSpec.scala | 2 +- .../src/main/scala/com/google/protobuf/any/Any.scala | 2 +- .../src/main/scala/com/google/protobuf/api/Api.scala | 2 +- .../main/scala/com/google/protobuf/api/Method.scala | 2 +- .../main/scala/com/google/protobuf/api/Mixin.scala | 2 +- .../compiler/plugin/CodeGeneratorRequest.scala | 2 +- .../compiler/plugin/CodeGeneratorResponse.scala | 4 ++-- .../com/google/protobuf/compiler/plugin/Version.scala | 2 +- .../google/protobuf/descriptor/DescriptorProto.scala | 6 +++--- .../protobuf/descriptor/EnumDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/EnumOptions.scala | 2 +- .../descriptor/EnumValueDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/EnumValueOptions.scala | 2 +- .../protobuf/descriptor/FieldDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/FieldOptions.scala | 2 +- .../protobuf/descriptor/FileDescriptorProto.scala | 2 +- .../protobuf/descriptor/FileDescriptorSet.scala | 2 +- .../com/google/protobuf/descriptor/FileOptions.scala | 2 +- .../protobuf/descriptor/GeneratedCodeInfo.scala | 4 ++-- .../google/protobuf/descriptor/MessageOptions.scala | 2 +- .../protobuf/descriptor/MethodDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/MethodOptions.scala | 2 +- .../protobuf/descriptor/OneofDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/OneofOptions.scala | 2 +- .../protobuf/descriptor/ServiceDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/ServiceOptions.scala | 2 +- .../google/protobuf/descriptor/SourceCodeInfo.scala | 4 ++-- .../protobuf/descriptor/UninterpretedOption.scala | 4 ++-- .../scala/com/google/protobuf/duration/Duration.scala | 2 +- .../main/scala/com/google/protobuf/empty/Empty.scala | 2 +- .../com/google/protobuf/field_mask/FieldMask.scala | 2 +- .../protobuf/source_context/SourceContext.scala | 2 +- .../scala/com/google/protobuf/struct/ListValue.scala | 2 +- .../scala/com/google/protobuf/struct/Struct.scala | 4 ++-- .../main/scala/com/google/protobuf/struct/Value.scala | 2 +- .../com/google/protobuf/timestamp/Timestamp.scala | 2 +- .../main/scala/com/google/protobuf/type/Enum.scala | 2 +- .../scala/com/google/protobuf/type/EnumValue.scala | 2 +- .../main/scala/com/google/protobuf/type/Field.scala | 2 +- .../scala/com/google/protobuf/type/OptionProto.scala | 2 +- .../main/scala/com/google/protobuf/type/Type.scala | 2 +- .../com/google/protobuf/wrappers/BoolValue.scala | 2 +- .../com/google/protobuf/wrappers/BytesValue.scala | 2 +- .../com/google/protobuf/wrappers/DoubleValue.scala | 2 +- .../com/google/protobuf/wrappers/FloatValue.scala | 2 +- .../com/google/protobuf/wrappers/Int32Value.scala | 2 +- .../com/google/protobuf/wrappers/Int64Value.scala | 2 +- .../com/google/protobuf/wrappers/StringValue.scala | 2 +- .../com/google/protobuf/wrappers/UInt32Value.scala | 2 +- .../com/google/protobuf/wrappers/UInt64Value.scala | 2 +- .../src/main/scala/com/google/protobuf/any/Any.scala | 2 +- .../src/main/scala/com/google/protobuf/api/Api.scala | 2 +- .../main/scala/com/google/protobuf/api/Method.scala | 2 +- .../main/scala/com/google/protobuf/api/Mixin.scala | 2 +- .../compiler/plugin/CodeGeneratorRequest.scala | 2 +- .../compiler/plugin/CodeGeneratorResponse.scala | 4 ++-- .../com/google/protobuf/compiler/plugin/Version.scala | 2 +- .../google/protobuf/descriptor/DescriptorProto.scala | 6 +++--- .../protobuf/descriptor/EnumDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/EnumOptions.scala | 2 +- .../descriptor/EnumValueDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/EnumValueOptions.scala | 2 +- .../protobuf/descriptor/FieldDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/FieldOptions.scala | 2 +- .../protobuf/descriptor/FileDescriptorProto.scala | 2 +- .../protobuf/descriptor/FileDescriptorSet.scala | 2 +- .../com/google/protobuf/descriptor/FileOptions.scala | 2 +- .../protobuf/descriptor/GeneratedCodeInfo.scala | 4 ++-- .../google/protobuf/descriptor/MessageOptions.scala | 2 +- .../protobuf/descriptor/MethodDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/MethodOptions.scala | 2 +- .../protobuf/descriptor/OneofDescriptorProto.scala | 2 +- .../com/google/protobuf/descriptor/OneofOptions.scala | 2 +- .../protobuf/descriptor/ServiceDescriptorProto.scala | 2 +- .../google/protobuf/descriptor/ServiceOptions.scala | 2 +- .../google/protobuf/descriptor/SourceCodeInfo.scala | 4 ++-- .../protobuf/descriptor/UninterpretedOption.scala | 4 ++-- .../scala/com/google/protobuf/duration/Duration.scala | 2 +- .../main/scala/com/google/protobuf/empty/Empty.scala | 2 +- .../com/google/protobuf/field_mask/FieldMask.scala | 2 +- .../protobuf/source_context/SourceContext.scala | 2 +- .../scala/com/google/protobuf/struct/ListValue.scala | 2 +- .../scala/com/google/protobuf/struct/Struct.scala | 4 ++-- .../main/scala/com/google/protobuf/struct/Value.scala | 2 +- .../com/google/protobuf/timestamp/Timestamp.scala | 2 +- .../main/scala/com/google/protobuf/type/Enum.scala | 2 +- .../scala/com/google/protobuf/type/EnumValue.scala | 2 +- .../main/scala/com/google/protobuf/type/Field.scala | 2 +- .../scala/com/google/protobuf/type/OptionProto.scala | 2 +- .../main/scala/com/google/protobuf/type/Type.scala | 2 +- .../com/google/protobuf/wrappers/BoolValue.scala | 2 +- .../com/google/protobuf/wrappers/BytesValue.scala | 2 +- .../com/google/protobuf/wrappers/DoubleValue.scala | 2 +- .../com/google/protobuf/wrappers/FloatValue.scala | 2 +- .../com/google/protobuf/wrappers/Int32Value.scala | 2 +- .../com/google/protobuf/wrappers/Int64Value.scala | 2 +- .../com/google/protobuf/wrappers/StringValue.scala | 2 +- .../com/google/protobuf/wrappers/UInt32Value.scala | 2 +- .../com/google/protobuf/wrappers/UInt64Value.scala | 2 +- .../scala/scalapb/GeneratedMessageCompanion.scala | 11 ++++++++++- .../src/main/scala/scalapb/options/EnumOptions.scala | 2 +- .../main/scala/scalapb/options/EnumValueOptions.scala | 2 +- .../src/main/scala/scalapb/options/FieldOptions.scala | 2 +- .../main/scala/scalapb/options/MessageOptions.scala | 2 +- .../src/main/scala/scalapb/options/OneofOptions.scala | 2 +- .../main/scala/scalapb/options/ScalaPbOptions.scala | 2 +- 114 files changed, 152 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cd264329..b637c1e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ Changes: type classes that deal with Oneofs. - Add support for Scala annotations on field-level, and companion object level. - It is now possible to specify additional traits for oneofs. +- #235: toString is now not overridden by ScalaPB and does not generate the + default TextFormat. To get the text format, use toProtoString. See issue #235 + for how to achieve a backwards-compatible behavior. ## [v0.6.7](https://github.com/scalapb/ScalaPB/tree/v0.6.6) (2017-11-23) [Full Changelog](https://github.com/scalapb/ScalaPB/compare/v0.6.0...v0.6.7) diff --git a/compiler-plugin/src/main/scala/scalapb/compiler/ProtobufGenerator.scala b/compiler-plugin/src/main/scala/scalapb/compiler/ProtobufGenerator.scala index 2848da3b0..b0f82d397 100644 --- a/compiler-plugin/src/main/scala/scalapb/compiler/ProtobufGenerator.scala +++ b/compiler-plugin/src/main/scala/scalapb/compiler/ProtobufGenerator.scala @@ -10,7 +10,8 @@ import scala.collection.JavaConverters._ case class GeneratorParams( javaConversions: Boolean = false, flatPackage: Boolean = false, - grpc: Boolean = false, singleLineToString: Boolean = false) + grpc: Boolean = false, singleLineToProtoString: Boolean = false, + asciiFormatToString: Boolean = false) // Exceptions that are caught and passed upstreams as errors. case class GeneratorException(message: String) extends Exception(message) @@ -1228,8 +1229,9 @@ class ProtobufGenerator(val params: GeneratorParams) extends DescriptorPimps { ) .call(generateGetField(message)) .call(generateGetFieldPValue(message)) - .when(!params.singleLineToString)(_.add(s"override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this)")) - .when(params.singleLineToString)(_.add(s"override def toString: String = _root_.scalapb.TextFormat.printToSingleLineUnicodeString(this)")) + .when(!params.singleLineToProtoString)(_.add(s"def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this)")) + .when(params.singleLineToProtoString)(_.add(s"def toProtoString: String = _root_.scalapb.TextFormat.printToSingleLineUnicodeString(this)")) + .when(params.asciiFormatToString)(_.add("override def toString: String = toProtoString")) .add(s"def companion = ${message.scalaTypeNameWithMaybeRoot(message)}") .outdent .outdent @@ -1389,7 +1391,8 @@ object ProtobufGenerator { case (Right(params), "java_conversions") => Right(params.copy(javaConversions = true)) case (Right(params), "flat_package") => Right(params.copy(flatPackage = true)) case (Right(params), "grpc") => Right(params.copy(grpc = true)) - case (Right(params), "single_line_to_string") => Right(params.copy(singleLineToString = true)) + case (Right(params), "single_line_to_proto_string") => Right(params.copy(singleLineToProtoString = true)) + case (Right(params), "ascii_format_to_string") => Right(params.copy(asciiFormatToString = true)) case (Right(params), p) => Left(s"Unrecognized parameter: '$p'") case (x, _) => x } diff --git a/compiler-plugin/src/main/scala/scalapb/package.scala b/compiler-plugin/src/main/scala/scalapb/package.scala index b03868cd3..d0fde24ae 100644 --- a/compiler-plugin/src/main/scala/scalapb/package.scala +++ b/compiler-plugin/src/main/scala/scalapb/package.scala @@ -5,7 +5,9 @@ package object scalapb { flatPackage: Boolean = false, javaConversions: Boolean = false, grpc: Boolean = true, - singleLineToString: Boolean = false): (JvmGenerator, Seq[String]) = + singleLineToProtoString: Boolean = false, + asciiFormatToString: Boolean = false + ): (JvmGenerator, Seq[String]) = (JvmGenerator( "scala", ScalaPbCodeGenerator), @@ -13,6 +15,7 @@ package object scalapb { "flat_package" -> flatPackage, "java_conversions" -> javaConversions, "grpc" -> grpc, - "single_line_to_string" -> singleLineToString + "single_line_to_proto_string" -> singleLineToProtoString, + "ascii_format_to_string" -> asciiFormatToString ).collect { case (name, v) if v => name }) } diff --git a/e2e/src/test/scala/CollectionTypesSpec.scala b/e2e/src/test/scala/CollectionTypesSpec.scala index 4bf4eca48..2fbf06689 100644 --- a/e2e/src/test/scala/CollectionTypesSpec.scala +++ b/e2e/src/test/scala/CollectionTypesSpec.scala @@ -17,7 +17,7 @@ class CollectionTypesSpec extends FlatSpec with MustMatchers { "custom collection" should "work" in { val c = CustomCollection(repeatedInt32 = MyVector(Vector(11, 24, 19))) CustomCollection.parseFrom(c.toByteArray) must be(c) - CustomCollection.fromAscii(c.toString) must be(c) + CustomCollection.fromAscii(c.toProtoString) must be(c) CustomCollection.fromJavaProto(CustomCollection.toJavaProto(c)) must be(c) } diff --git a/e2e/src/test/scala/EnumSpec.scala b/e2e/src/test/scala/EnumSpec.scala index c22bbc53d..5bcf7e842 100644 --- a/e2e/src/test/scala/EnumSpec.scala +++ b/e2e/src/test/scala/EnumSpec.scala @@ -129,7 +129,7 @@ class EnumSpec extends FlatSpec with MustMatchers with OptionValues { "Unrecognized" should "be printable" in { // See https://github.com/scalapb/ScalaPB/issues/225 - unrecognized.toString must be ("color: 37\n") + unrecognized.toProtoString must be ("color: 37\n") } "Unrecognized" should "be fine" in { diff --git a/e2e/src/test/scala/MapsSpec.scala b/e2e/src/test/scala/MapsSpec.scala index 3269c4351..4161bba86 100644 --- a/e2e/src/test/scala/MapsSpec.scala +++ b/e2e/src/test/scala/MapsSpec.scala @@ -151,11 +151,11 @@ class MapsSpec extends FlatSpec with GeneratorDrivenPropertyChecks with MustMatc personToYear = Map(PersonId("275") -> Years(188))) CustomMaps.parseFrom(c1.toByteArray) must be(c1) - CustomMaps.fromAscii(c1.toString) must be(c1) + CustomMaps.fromAscii(c1.toProtoString) must be(c1) CustomMaps.fromJavaProto(CustomMaps.toJavaProto(c1)) must be (c1) CustomMaps2.parseFrom(c2.toByteArray) must be(c2) - CustomMaps2.fromAscii(c2.toString) must be(c2) + CustomMaps2.fromAscii(c2.toProtoString) must be(c2) CustomMaps2.fromJavaProto(CustomMaps2.toJavaProto(c2)) must be (c2) } } diff --git a/e2e/src/test/scala/RepeatablesSpec.scala b/e2e/src/test/scala/RepeatablesSpec.scala index 97485255c..da3877600 100644 --- a/e2e/src/test/scala/RepeatablesSpec.scala +++ b/e2e/src/test/scala/RepeatablesSpec.scala @@ -13,7 +13,7 @@ class RepeatablesSpec extends FlatSpec with GeneratorDrivenPropertyChecks with M Arbitrary.arbitrary[Option[Int]].map(s => Nested(nestedField = s)) "toString" should "give empty string" in { - RepeatablesTest().toString must be("") + RepeatablesTest().toProtoString must be("") } def mergeRepeatables(rep1: RepeatablesTest, rep2: RepeatablesTest) = diff --git a/e2e/src/test/scala/scalapb/TextFormatSpec.scala b/e2e/src/test/scala/scalapb/TextFormatSpec.scala index f861e2881..9d15c69c3 100644 --- a/e2e/src/test/scala/scalapb/TextFormatSpec.scala +++ b/e2e/src/test/scala/scalapb/TextFormatSpec.scala @@ -193,7 +193,7 @@ class TextFormatSpec extends FlatSpec with GeneratorDrivenPropertyChecks with Mu "repeated_double: Infinity\n" + "repeated_double: -Infinity\n" + "repeated_double: NaN\n"; - TestAllTypes.fromAscii(original).toString must be(canonical) + TestAllTypes.fromAscii(original).toProtoString must be(canonical) } "testParseExotic" should "pass" in { @@ -469,7 +469,7 @@ class TextFormatSpec extends FlatSpec with GeneratorDrivenPropertyChecks with Mu "repeated_bool: false\n" + "repeated_bool: true\n" val good = TestAllTypes.fromAscii(goodText) - goodTextCanonical must be(good.toString) + goodTextCanonical must be(good.toProtoString) "optional_bool:2" must failParsingWith("") "optional_bool:foo" must failParsingWith("") @@ -573,7 +573,7 @@ class TextFormatSpec extends FlatSpec with GeneratorDrivenPropertyChecks with Mu _.bazInt := 102, _.bazString := "103" ) - TestOneof2.fromAscii(p.toString) must be(p) + TestOneof2.fromAscii(p.toProtoString) must be(p) } "testOneofOverwriteAllowed" should "pass" in { diff --git a/proptest/src/test/scala/GeneratedCodeSpec.scala b/proptest/src/test/scala/GeneratedCodeSpec.scala index 44b2fe393..6c7f32000 100644 --- a/proptest/src/test/scala/GeneratedCodeSpec.scala +++ b/proptest/src/test/scala/GeneratedCodeSpec.scala @@ -45,7 +45,7 @@ class GeneratedCodeSpec extends PropSpec with GeneratorDrivenPropertyChecks with // Parsing in Scala the serialized bytes should give the same object. val scalaParsedFromBytes = companion.parseFrom(scalaBytes) - scalaParsedFromBytes.toString should be(scalaProto.toString) + scalaParsedFromBytes.toProtoString should be(scalaProto.toProtoString) scalaParsedFromBytes should be(scalaProto) // Parsing in Java the bytes serialized by Scala should give back javaProto: diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/any/Any.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/any/Any.scala index 9d1fc0505..d05003356 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/any/Any.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/any/Any.scala @@ -176,7 +176,7 @@ final case class Any( case 2 => _root_.scalapb.descriptors.PByteString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.any.Any } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Api.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Api.scala index e573b71d8..5fb2ffa88 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Api.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Api.scala @@ -204,7 +204,7 @@ final case class Api( case 7 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Api } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Method.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Method.scala index 8edfd6f25..02bc89d8a 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Method.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Method.scala @@ -187,7 +187,7 @@ final case class Method( case 7 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Method } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Mixin.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Mixin.scala index 4077787ad..96471de99 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Mixin.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/api/Mixin.scala @@ -165,7 +165,7 @@ final case class Mixin( case 2 => _root_.scalapb.descriptors.PString(root) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Mixin } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala index 3adfd3ffa..2227b1caf 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala @@ -133,7 +133,7 @@ final case class CodeGeneratorRequest( case 3 => compilerVersion.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorRequest } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala index 3bcee6f31..514420345 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala @@ -88,7 +88,7 @@ final case class CodeGeneratorResponse( case 15 => _root_.scalapb.descriptors.PRepeated(file.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorResponse } @@ -263,7 +263,7 @@ object CodeGeneratorResponse extends scalapb.GeneratedMessageCompanion[com.googl case 15 => content.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorResponse.File } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala index a267ab197..4e9e95e51 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala @@ -107,7 +107,7 @@ final case class Version( case 4 => suffix.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.Version } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala index b0bac2d51..2095eade1 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala @@ -215,7 +215,7 @@ final case class DescriptorProto( case 10 => _root_.scalapb.descriptors.PRepeated(reservedName.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto } @@ -345,7 +345,7 @@ object DescriptorProto extends scalapb.GeneratedMessageCompanion[com.google.prot case 2 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto.ExtensionRange } @@ -462,7 +462,7 @@ object DescriptorProto extends scalapb.GeneratedMessageCompanion[com.google.prot case 2 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto.ReservedRange } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala index 3da745966..b4fa872e7 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala @@ -94,7 +94,7 @@ final case class EnumDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala index 09a9d0892..40ece1826 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala @@ -108,7 +108,7 @@ final case class EnumOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala index 0e09564b2..f028cc317 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala @@ -91,7 +91,7 @@ final case class EnumValueDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumValueDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala index 951a517c9..382a4ca55 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala @@ -91,7 +91,7 @@ final case class EnumValueOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumValueOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala index 701a9985f..386d8f5c1 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala @@ -216,7 +216,7 @@ final case class FieldDescriptorProto( case 8 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FieldDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala index 244db62e8..b54d6108b 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala @@ -213,7 +213,7 @@ final case class FieldOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FieldOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala index d5443f43d..0b1aeeab7 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala @@ -272,7 +272,7 @@ final case class FileDescriptorProto( case 12 => syntax.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala index ff196fabd..fe14e4356 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala @@ -65,7 +65,7 @@ final case class FileDescriptorSet( case 1 => _root_.scalapb.descriptors.PRepeated(file.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileDescriptorSet } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala index d3871c386..ad569cbda 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala @@ -361,7 +361,7 @@ final case class FileOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala index cdd814b99..e412ed635 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala @@ -70,7 +70,7 @@ final case class GeneratedCodeInfo( case 1 => _root_.scalapb.descriptors.PRepeated(annotation.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.GeneratedCodeInfo } @@ -238,7 +238,7 @@ object GeneratedCodeInfo extends scalapb.GeneratedMessageCompanion[com.google.pr case 4 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.GeneratedCodeInfo.Annotation } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala index 01c4e5009..607f7293c 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala @@ -178,7 +178,7 @@ final case class MessageOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MessageOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala index 1f7fee267..489c6a0f5 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala @@ -141,7 +141,7 @@ final case class MethodDescriptorProto( case 6 => serverStreaming.map(_root_.scalapb.descriptors.PBoolean).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MethodDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala index b5d7a6fb9..65fd240db 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala @@ -105,7 +105,7 @@ final case class MethodOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MethodOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala index a0aa90d64..ee14cd556 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala @@ -77,7 +77,7 @@ final case class OneofDescriptorProto( case 2 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.OneofDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala index 268332268..e8327fac7 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala @@ -72,7 +72,7 @@ final case class OneofOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.OneofOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala index 0b51d9925..ca69e5f14 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala @@ -94,7 +94,7 @@ final case class ServiceDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.ServiceDescriptorProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala index 6131307d5..917804385 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala @@ -91,7 +91,7 @@ final case class ServiceOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.ServiceOptions } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala index e57518ed8..af6db3bb1 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala @@ -110,7 +110,7 @@ final case class SourceCodeInfo( case 1 => _root_.scalapb.descriptors.PRepeated(location.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.SourceCodeInfo } @@ -382,7 +382,7 @@ object SourceCodeInfo extends scalapb.GeneratedMessageCompanion[com.google.proto case 6 => _root_.scalapb.descriptors.PRepeated(leadingDetachedComments.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.SourceCodeInfo.Location } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala index 8376d0e93..6ad383d5f 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala @@ -157,7 +157,7 @@ final case class UninterpretedOption( case 8 => aggregateValue.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.UninterpretedOption } @@ -275,7 +275,7 @@ object UninterpretedOption extends scalapb.GeneratedMessageCompanion[com.google. case 2 => _root_.scalapb.descriptors.PBoolean(isExtension) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.UninterpretedOption.NamePart } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/duration/Duration.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/duration/Duration.scala index 83102dd01..dae46a324 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/duration/Duration.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/duration/Duration.scala @@ -152,7 +152,7 @@ final case class Duration( case 2 => _root_.scalapb.descriptors.PInt(nanos) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.duration.Duration } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/empty/Empty.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/empty/Empty.scala index 1e800ef89..6868de969 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/empty/Empty.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/empty/Empty.scala @@ -35,7 +35,7 @@ final case class Empty( } def getFieldByNumber(__fieldNumber: Int): scala.Any = throw new MatchError(__fieldNumber) def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = throw new MatchError(__field) - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.empty.Empty } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala index d4e9e3e61..0351539bc 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala @@ -265,7 +265,7 @@ final case class FieldMask( case 1 => _root_.scalapb.descriptors.PRepeated(paths.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.field_mask.FieldMask } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/source_context/SourceContext.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/source_context/SourceContext.scala index 75f30d319..ea2215e31 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/source_context/SourceContext.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/source_context/SourceContext.scala @@ -70,7 +70,7 @@ final case class SourceContext( case 1 => _root_.scalapb.descriptors.PString(fileName) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.source_context.SourceContext } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/ListValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/ListValue.scala index cc06351d9..a95b5a330 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/ListValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/ListValue.scala @@ -69,7 +69,7 @@ final case class ListValue( case 1 => _root_.scalapb.descriptors.PRepeated(values.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.ListValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Struct.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Struct.scala index cfaa27969..9c84a5c66 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Struct.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Struct.scala @@ -74,7 +74,7 @@ final case class Struct( case 1 => _root_.scalapb.descriptors.PRepeated(fields.map(com.google.protobuf.struct.Struct._typemapper_fields.toBase(_).toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Struct } @@ -184,7 +184,7 @@ object Struct extends scalapb.GeneratedMessageCompanion[com.google.protobuf.stru case 2 => value.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Struct.FieldsEntry } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Value.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Value.scala index 7f7309536..7044a4955 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Value.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/struct/Value.scala @@ -121,7 +121,7 @@ final case class Value( case 6 => kind.listValue.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Value } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala index ee1a9d178..95baf5b4f 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala @@ -168,7 +168,7 @@ final case class Timestamp( case 2 => _root_.scalapb.descriptors.PInt(nanos) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.timestamp.Timestamp } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Enum.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Enum.scala index 9917ed061..dc13af0de 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Enum.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Enum.scala @@ -144,7 +144,7 @@ final case class Enum( case 5 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Enum } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/EnumValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/EnumValue.scala index 96078f7cc..e40d8bb9c 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/EnumValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/EnumValue.scala @@ -107,7 +107,7 @@ final case class EnumValue( case 3 => _root_.scalapb.descriptors.PRepeated(options.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.EnumValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Field.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Field.scala index 7d42009ee..b042e5285 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Field.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Field.scala @@ -249,7 +249,7 @@ final case class Field( case 11 => _root_.scalapb.descriptors.PString(defaultValue) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Field } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/OptionProto.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/OptionProto.scala index dedb2d199..a94fbebea 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/OptionProto.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/OptionProto.scala @@ -93,7 +93,7 @@ final case class OptionProto( case 2 => value.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.OptionProto } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Type.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Type.scala index 226dccb4f..fec8537a3 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Type.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/type/Type.scala @@ -161,7 +161,7 @@ final case class Type( case 6 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Type } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala index f517c3503..673fc1109 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala @@ -70,7 +70,7 @@ final case class BoolValue( case 1 => _root_.scalapb.descriptors.PBoolean(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.BoolValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala index 3b9a0a47d..f14d84132 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala @@ -70,7 +70,7 @@ final case class BytesValue( case 1 => _root_.scalapb.descriptors.PByteString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.BytesValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala index 7305464d6..7d4ea7d2c 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala @@ -70,7 +70,7 @@ final case class DoubleValue( case 1 => _root_.scalapb.descriptors.PDouble(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.DoubleValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala index 167c56d5b..f5512934b 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala @@ -70,7 +70,7 @@ final case class FloatValue( case 1 => _root_.scalapb.descriptors.PFloat(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.FloatValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala index 141ddf604..354a115b1 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala @@ -70,7 +70,7 @@ final case class Int32Value( case 1 => _root_.scalapb.descriptors.PInt(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.Int32Value } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala index 950d17bfb..b1f75a7b3 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala @@ -70,7 +70,7 @@ final case class Int64Value( case 1 => _root_.scalapb.descriptors.PLong(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.Int64Value } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/StringValue.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/StringValue.scala index 7555ec6b9..b2546c4fd 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/StringValue.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/StringValue.scala @@ -70,7 +70,7 @@ final case class StringValue( case 1 => _root_.scalapb.descriptors.PString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.StringValue } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala index de2a867ff..861ee3012 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala @@ -70,7 +70,7 @@ final case class UInt32Value( case 1 => _root_.scalapb.descriptors.PInt(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.UInt32Value } diff --git a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala index c29079984..a59c331d5 100644 --- a/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala +++ b/scalapb-runtime/js/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala @@ -70,7 +70,7 @@ final case class UInt64Value( case 1 => _root_.scalapb.descriptors.PLong(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.UInt64Value } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/any/Any.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/any/Any.scala index 54d533c77..e9dc6d859 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/any/Any.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/any/Any.scala @@ -176,7 +176,7 @@ final case class Any( case 2 => _root_.scalapb.descriptors.PByteString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.any.Any } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Api.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Api.scala index 96271afce..ec712c792 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Api.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Api.scala @@ -205,7 +205,7 @@ final case class Api( case 7 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Api } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Method.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Method.scala index 56ccb8941..4a0acbe0c 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Method.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Method.scala @@ -188,7 +188,7 @@ final case class Method( case 7 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Method } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Mixin.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Mixin.scala index 0eb2f9042..df92c5eb4 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Mixin.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/api/Mixin.scala @@ -165,7 +165,7 @@ final case class Mixin( case 2 => _root_.scalapb.descriptors.PString(root) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.api.Mixin } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala index 6fcff0a83..64f8a7755 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorRequest.scala @@ -134,7 +134,7 @@ final case class CodeGeneratorRequest( case 3 => compilerVersion.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorRequest } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala index 2aff16bb0..aaea9e1b7 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/CodeGeneratorResponse.scala @@ -89,7 +89,7 @@ final case class CodeGeneratorResponse( case 15 => _root_.scalapb.descriptors.PRepeated(file.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorResponse } @@ -274,7 +274,7 @@ object CodeGeneratorResponse extends scalapb.GeneratedMessageCompanion[com.googl case 15 => content.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.CodeGeneratorResponse.File } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala index 2162db21b..71e7418b9 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/compiler/plugin/Version.scala @@ -107,7 +107,7 @@ final case class Version( case 4 => suffix.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.compiler.plugin.Version } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala index 843d22848..f2cf60954 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/DescriptorProto.scala @@ -216,7 +216,7 @@ final case class DescriptorProto( case 10 => _root_.scalapb.descriptors.PRepeated(reservedName.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto } @@ -372,7 +372,7 @@ object DescriptorProto extends scalapb.GeneratedMessageCompanion[com.google.prot case 2 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto.ExtensionRange } @@ -499,7 +499,7 @@ object DescriptorProto extends scalapb.GeneratedMessageCompanion[com.google.prot case 2 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.DescriptorProto.ReservedRange } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala index 2942a95a9..74ee4db73 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumDescriptorProto.scala @@ -95,7 +95,7 @@ final case class EnumDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala index b34b3bcc4..50d96b31f 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumOptions.scala @@ -109,7 +109,7 @@ final case class EnumOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala index d45b3be2b..13ce92481 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueDescriptorProto.scala @@ -91,7 +91,7 @@ final case class EnumValueDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumValueDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala index 22c6a8e1f..d086e6540 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/EnumValueOptions.scala @@ -92,7 +92,7 @@ final case class EnumValueOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.EnumValueOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala index f257ff74f..3ba0452a8 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldDescriptorProto.scala @@ -216,7 +216,7 @@ final case class FieldDescriptorProto( case 8 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FieldDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala index f5ca39873..bd79e4feb 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FieldOptions.scala @@ -214,7 +214,7 @@ final case class FieldOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FieldOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala index 332faa1b1..6a975f94c 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorProto.scala @@ -273,7 +273,7 @@ final case class FileDescriptorProto( case 12 => syntax.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala index 04e99d605..10ad55b81 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileDescriptorSet.scala @@ -66,7 +66,7 @@ final case class FileDescriptorSet( case 1 => _root_.scalapb.descriptors.PRepeated(file.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileDescriptorSet } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala index 41bf92653..43ae47d49 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/FileOptions.scala @@ -362,7 +362,7 @@ final case class FileOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.FileOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala index bb33398bd..386bc4b00 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/GeneratedCodeInfo.scala @@ -71,7 +71,7 @@ final case class GeneratedCodeInfo( case 1 => _root_.scalapb.descriptors.PRepeated(annotation.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.GeneratedCodeInfo } @@ -247,7 +247,7 @@ object GeneratedCodeInfo extends scalapb.GeneratedMessageCompanion[com.google.pr case 4 => end.map(_root_.scalapb.descriptors.PInt).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.GeneratedCodeInfo.Annotation } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala index 0af4a2661..79e7ece25 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MessageOptions.scala @@ -179,7 +179,7 @@ final case class MessageOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MessageOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala index 3d9647ef3..5dfce5c92 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodDescriptorProto.scala @@ -141,7 +141,7 @@ final case class MethodDescriptorProto( case 6 => serverStreaming.map(_root_.scalapb.descriptors.PBoolean).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MethodDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala index 1eb085527..2feb83fd6 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/MethodOptions.scala @@ -106,7 +106,7 @@ final case class MethodOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.MethodOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala index f2aa56419..96f623e38 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofDescriptorProto.scala @@ -77,7 +77,7 @@ final case class OneofDescriptorProto( case 2 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.OneofDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala index db27da3ed..19af6ad8a 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/OneofOptions.scala @@ -73,7 +73,7 @@ final case class OneofOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.OneofOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala index 5a489cb0a..a6b29ea45 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceDescriptorProto.scala @@ -95,7 +95,7 @@ final case class ServiceDescriptorProto( case 3 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.ServiceDescriptorProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala index 91a9704af..e2393db7e 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala @@ -92,7 +92,7 @@ final case class ServiceOptions( case 999 => _root_.scalapb.descriptors.PRepeated(uninterpretedOption.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.ServiceOptions } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala index 47aeba8d1..d265c2d6b 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/SourceCodeInfo.scala @@ -111,7 +111,7 @@ final case class SourceCodeInfo( case 1 => _root_.scalapb.descriptors.PRepeated(location.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.SourceCodeInfo } @@ -391,7 +391,7 @@ object SourceCodeInfo extends scalapb.GeneratedMessageCompanion[com.google.proto case 6 => _root_.scalapb.descriptors.PRepeated(leadingDetachedComments.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.SourceCodeInfo.Location } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala index 203afd003..65eb0cd46 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/descriptor/UninterpretedOption.scala @@ -158,7 +158,7 @@ final case class UninterpretedOption( case 8 => aggregateValue.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.UninterpretedOption } @@ -296,7 +296,7 @@ object UninterpretedOption extends scalapb.GeneratedMessageCompanion[com.google. case 2 => _root_.scalapb.descriptors.PBoolean(isExtension) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.descriptor.UninterpretedOption.NamePart } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/duration/Duration.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/duration/Duration.scala index 03de4a5b2..94258719c 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/duration/Duration.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/duration/Duration.scala @@ -152,7 +152,7 @@ final case class Duration( case 2 => _root_.scalapb.descriptors.PInt(nanos) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.duration.Duration } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/empty/Empty.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/empty/Empty.scala index 309c4a4af..591ce7ea7 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/empty/Empty.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/empty/Empty.scala @@ -35,7 +35,7 @@ final case class Empty( } def getFieldByNumber(__fieldNumber: Int): scala.Any = throw new MatchError(__fieldNumber) def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = throw new MatchError(__field) - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.empty.Empty } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala index d3a8817ee..8621f18db 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/field_mask/FieldMask.scala @@ -266,7 +266,7 @@ final case class FieldMask( case 1 => _root_.scalapb.descriptors.PRepeated(paths.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.field_mask.FieldMask } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/source_context/SourceContext.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/source_context/SourceContext.scala index c397b3e1d..bda67f0f8 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/source_context/SourceContext.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/source_context/SourceContext.scala @@ -70,7 +70,7 @@ final case class SourceContext( case 1 => _root_.scalapb.descriptors.PString(fileName) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.source_context.SourceContext } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/ListValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/ListValue.scala index f92f2dc92..93c8df12b 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/ListValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/ListValue.scala @@ -70,7 +70,7 @@ final case class ListValue( case 1 => _root_.scalapb.descriptors.PRepeated(values.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.ListValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Struct.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Struct.scala index 899828974..c49f18e04 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Struct.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Struct.scala @@ -75,7 +75,7 @@ final case class Struct( case 1 => _root_.scalapb.descriptors.PRepeated(fields.map(com.google.protobuf.struct.Struct._typemapper_fields.toBase(_).toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Struct } @@ -199,7 +199,7 @@ object Struct extends scalapb.GeneratedMessageCompanion[com.google.protobuf.stru case 2 => value.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Struct.FieldsEntry } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Value.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Value.scala index 224c54754..0e47c7809 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Value.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/Value.scala @@ -121,7 +121,7 @@ final case class Value( case 6 => kind.listValue.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.struct.Value } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala index 92824d425..b5a8f56d9 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/timestamp/Timestamp.scala @@ -168,7 +168,7 @@ final case class Timestamp( case 2 => _root_.scalapb.descriptors.PInt(nanos) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.timestamp.Timestamp } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Enum.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Enum.scala index 8d0d38b20..bfc532ce3 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Enum.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Enum.scala @@ -145,7 +145,7 @@ final case class Enum( case 5 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Enum } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/EnumValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/EnumValue.scala index d3f35f8a0..a0fcf67b7 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/EnumValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/EnumValue.scala @@ -108,7 +108,7 @@ final case class EnumValue( case 3 => _root_.scalapb.descriptors.PRepeated(options.map(_.toPMessage)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.EnumValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Field.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Field.scala index 3372f22f8..aa55ebdbc 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Field.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Field.scala @@ -250,7 +250,7 @@ final case class Field( case 11 => _root_.scalapb.descriptors.PString(defaultValue) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Field } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/OptionProto.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/OptionProto.scala index 48aad2c6c..a4c744e9e 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/OptionProto.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/OptionProto.scala @@ -93,7 +93,7 @@ final case class OptionProto( case 2 => value.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.OptionProto } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Type.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Type.scala index f8935b07e..8a0d47a6b 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Type.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/type/Type.scala @@ -162,7 +162,7 @@ final case class Type( case 6 => _root_.scalapb.descriptors.PEnum(syntax.scalaValueDescriptor) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.`type`.Type } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala index d8543b015..dc3834a1e 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BoolValue.scala @@ -70,7 +70,7 @@ final case class BoolValue( case 1 => _root_.scalapb.descriptors.PBoolean(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.BoolValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala index 85725a436..674efffa6 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/BytesValue.scala @@ -70,7 +70,7 @@ final case class BytesValue( case 1 => _root_.scalapb.descriptors.PByteString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.BytesValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala index f031a7c2a..0f3846cc2 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/DoubleValue.scala @@ -70,7 +70,7 @@ final case class DoubleValue( case 1 => _root_.scalapb.descriptors.PDouble(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.DoubleValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala index 0620395df..1ab0666d5 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/FloatValue.scala @@ -70,7 +70,7 @@ final case class FloatValue( case 1 => _root_.scalapb.descriptors.PFloat(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.FloatValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala index 77f85c506..4393294c3 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int32Value.scala @@ -70,7 +70,7 @@ final case class Int32Value( case 1 => _root_.scalapb.descriptors.PInt(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.Int32Value } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala index 85e4792ff..42b826600 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/Int64Value.scala @@ -70,7 +70,7 @@ final case class Int64Value( case 1 => _root_.scalapb.descriptors.PLong(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.Int64Value } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/StringValue.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/StringValue.scala index 456ce18b2..3945aa253 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/StringValue.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/StringValue.scala @@ -70,7 +70,7 @@ final case class StringValue( case 1 => _root_.scalapb.descriptors.PString(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.StringValue } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala index e7c600c49..0f63d82ea 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt32Value.scala @@ -70,7 +70,7 @@ final case class UInt32Value( case 1 => _root_.scalapb.descriptors.PInt(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.UInt32Value } diff --git a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala index 85c59919a..aa56c311c 100644 --- a/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala +++ b/scalapb-runtime/jvm/src/main/scala/com/google/protobuf/wrappers/UInt64Value.scala @@ -70,7 +70,7 @@ final case class UInt64Value( case 1 => _root_.scalapb.descriptors.PLong(value) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = com.google.protobuf.wrappers.UInt64Value } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala b/scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala index 148a97170..5eaf21fb4 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/GeneratedMessageCompanion.scala @@ -144,6 +144,15 @@ trait GeneratedMessage extends Any with Serializable { } def serializedSize: Int + + /** Returns a human-readable ASCII format representation of this message. + * + * The original message can be decoded from this format by using fromAscii on + * the companion object. + * + * @return human-readable representation of this message. + */ + def toProtoString: String } trait Message[A] extends Any { @@ -228,7 +237,7 @@ trait GeneratedMessageCompanion[A <: GeneratedMessage with Message[A]] { enumCompanionForFieldNumber(field.getNumber) } - // The ASCII representation is the representation returned by toString. The following + // The ASCII representation is the representation returned by toProtoString. The following // functions allow you to convert the ASCII format back to a protocol buffer. These // functions are compatible with the Java implementation in the sense that anything that // was generated by TextFormat.printToString can be parsed by these functions. diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumOptions.scala index 31b551bb3..70b0646b1 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumOptions.scala @@ -97,7 +97,7 @@ final case class EnumOptions( case 3 => `type`.map(_root_.scalapb.descriptors.PString).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.EnumOptions } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumValueOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumValueOptions.scala index 54296f82a..636c5b9be 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumValueOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/EnumValueOptions.scala @@ -63,7 +63,7 @@ final case class EnumValueOptions( case 1 => _root_.scalapb.descriptors.PRepeated(`extends`.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.EnumValueOptions } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/FieldOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/FieldOptions.scala index f07b35e15..aa91b3684 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/FieldOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/FieldOptions.scala @@ -140,7 +140,7 @@ final case class FieldOptions( case 6 => _root_.scalapb.descriptors.PRepeated(annotations.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.FieldOptions } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/MessageOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/MessageOptions.scala index c109c85a0..224f5ad88 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/MessageOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/MessageOptions.scala @@ -131,7 +131,7 @@ final case class MessageOptions( case 5 => _root_.scalapb.descriptors.PRepeated(companionAnnotations.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.MessageOptions } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/OneofOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/OneofOptions.scala index 5f80fb86a..5a431afcc 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/OneofOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/OneofOptions.scala @@ -63,7 +63,7 @@ final case class OneofOptions( case 1 => _root_.scalapb.descriptors.PRepeated(`extends`.map(_root_.scalapb.descriptors.PString)(_root_.scala.collection.breakOut)) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.OneofOptions } diff --git a/scalapb-runtime/shared/src/main/scala/scalapb/options/ScalaPbOptions.scala b/scalapb-runtime/shared/src/main/scala/scalapb/options/ScalaPbOptions.scala index ba637815b..122520410 100644 --- a/scalapb-runtime/shared/src/main/scala/scalapb/options/ScalaPbOptions.scala +++ b/scalapb-runtime/shared/src/main/scala/scalapb/options/ScalaPbOptions.scala @@ -223,7 +223,7 @@ final case class ScalaPbOptions( case 100001 => testOnlyNoJavaConversions.map(_root_.scalapb.descriptors.PBoolean).getOrElse(_root_.scalapb.descriptors.PEmpty) } } - override def toString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def toProtoString: String = _root_.scalapb.TextFormat.printToUnicodeString(this) def companion = scalapb.options.ScalaPbOptions }