From c3010def80d9479611a9dacf28f705773ffaaff0 Mon Sep 17 00:00:00 2001 From: Nadav Samet Date: Mon, 6 Feb 2023 19:28:19 -0800 Subject: [PATCH] fix make_plugin_proto.sh and re-generate code --- .../com/thesamet/docs/json/JsonProto.scala | 32 +- .../com/thesamet/docs/json/MyContainer.scala | 175 ++--- .../com/thesamet/docs/json/MyMessage.scala | 166 ++--- .../generated/mytypes/duration/Duration.scala | 166 ++--- .../mytypes/duration/DurationProto.scala | 32 +- .../scalapb/docs/person/Person.scala | 607 ++++++++---------- .../scalapb/docs/person/PersonProto.scala | 30 +- .../generated/scalapb/perf/protos/Color.scala | 59 +- .../generated/scalapb/perf/protos/Enum.scala | 169 ++--- .../scalapb/perf/protos/EnumVector.scala | 196 +++--- .../scalapb/perf/protos/IntVector.scala | 188 +++--- .../perf/protos/MessageContainer.scala | 234 +++---- .../scalapb/perf/protos/ProtosProto.scala | 32 +- .../scalapb/perf/protos/SimpleMessage.scala | 334 +++++----- .../scalapb/perf/protos/StringMessage.scala | 221 +++---- make_plugin_proto.sh | 15 +- .../scalapb/options/MessageOptions.scala | 35 +- .../scala/scalapb/options/ScalapbProto.scala | 74 +-- 18 files changed, 1172 insertions(+), 1593 deletions(-) diff --git a/docs/src/main/scala/generated/com/thesamet/docs/json/JsonProto.scala b/docs/src/main/scala/generated/com/thesamet/docs/json/JsonProto.scala index bd37f237f..dd82a9d95 100644 --- a/docs/src/main/scala/generated/com/thesamet/docs/json/JsonProto.scala +++ b/docs/src/main/scala/generated/com/thesamet/docs/json/JsonProto.scala @@ -9,39 +9,27 @@ object JsonProto extends _root_.scalapb.GeneratedFileObject { lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq( com.google.protobuf.any.AnyProto ) - lazy val messagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( com.thesamet.docs.json.MyMessage, com.thesamet.docs.json.MyContainer ) private lazy val ProtoBytes: _root_.scala.Array[Byte] = - scalapb.Encoding.fromBase64( - scala.collection.immutable - .Seq( - """Cgpqc29uLnByb3RvEhFjb20udGhlc2FtZXQuZG9jcxoZZ29vZ2xlL3Byb3RvYnVmL2FueS5wcm90byIhCglNeU1lc3NhZ2USF + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """Cgpqc29uLnByb3RvEhFjb20udGhlc2FtZXQuZG9jcxoZZ29vZ2xlL3Byb3RvYnVmL2FueS5wcm90byIhCglNeU1lc3NhZ2USF AoBeBgBIAEoBUIG4j8DEgF4UgF4IkYKC015Q29udGFpbmVyEjcKBm15X2FueRgBIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnlCC uI/BxIFbXlBbnlSBW15QW55YgZwcm90bzM=""" - ) - .mkString - ) + ).mkString) lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) - _root_.scalapb.descriptors.FileDescriptor - .buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) } lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) - com.google.protobuf.Descriptors.FileDescriptor.buildFrom( - javaProto, - _root_.scala.Array( - com.google.protobuf.any.AnyProto.javaDescriptor - ) - ) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + com.google.protobuf.any.AnyProto.javaDescriptor + )) } - @deprecated( - "Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", - "ScalaPB 0.5.47" - ) + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor -} +} \ No newline at end of file diff --git a/docs/src/main/scala/generated/com/thesamet/docs/json/MyContainer.scala b/docs/src/main/scala/generated/com/thesamet/docs/json/MyContainer.scala index d370726b1..98d444961 100644 --- a/docs/src/main/scala/generated/com/thesamet/docs/json/MyContainer.scala +++ b/docs/src/main/scala/generated/com/thesamet/docs/json/MyContainer.scala @@ -9,82 +9,69 @@ package com.thesamet.docs.json final case class MyContainer( myAny: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[MyContainer] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - if (myAny.isDefined) { - val __value = myAny.get - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MyContainer] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + if (myAny.isDefined) { + val __value = myAny.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - myAny.foreach { __v => - val __m = __v - _output__.writeTag(1, 2) - _output__.writeUInt32NoTag(__m.serializedSize) - __m.writeTo(_output__) - }; - unknownFields.writeTo(_output__) - } - def getMyAny: com.google.protobuf.any.Any = - myAny.getOrElse(com.google.protobuf.any.Any.defaultInstance) - def clearMyAny: MyContainer = copy(myAny = _root_.scala.None) - def withMyAny(__v: com.google.protobuf.any.Any): MyContainer = copy(myAny = Option(__v)) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => myAny.orNull + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => myAny.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + myAny.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: com.thesamet.docs.json.MyContainer.type = com.thesamet.docs.json.MyContainer - // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyContainer]) + def getMyAny: com.google.protobuf.any.Any = myAny.getOrElse(com.google.protobuf.any.Any.defaultInstance) + def clearMyAny: MyContainer = copy(myAny = _root_.scala.None) + def withMyAny(__v: com.google.protobuf.any.Any): MyContainer = copy(myAny = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => myAny.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => myAny.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: com.thesamet.docs.json.MyContainer.type = com.thesamet.docs.json.MyContainer + // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyContainer]) } object MyContainer extends scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyContainer] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyContainer] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): com.thesamet.docs.json.MyContainer = { - var __myAny: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyContainer] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.thesamet.docs.json.MyContainer = { + var __myAny: _root_.scala.Option[com.google.protobuf.any.Any] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { case 0 => _done__ = true case 10 => - __myAny = Option( - __myAny.fold( - _root_.scalapb.LiteParser.readMessage[com.google.protobuf.any.Any](_input__) - )(_root_.scalapb.LiteParser.readMessage(_input__, _)) - ) + __myAny = Option(__myAny.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.any.Any](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) case tag => if (_unknownFields__ == null) { _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() @@ -93,59 +80,39 @@ object MyContainer extends scalapb.GeneratedMessageCompanion[com.thesamet.docs.j } } com.thesamet.docs.json.MyContainer( - myAny = __myAny, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + myAny = __myAny, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[com.thesamet.docs.json.MyContainer] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - com.thesamet.docs.json.MyContainer( - myAny = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .flatMap(_.as[_root_.scala.Option[com.google.protobuf.any.Any]]) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - JsonProto.javaDescriptor.getMessageTypes().get(1) + implicit def messageReads: _root_.scalapb.descriptors.Reads[com.thesamet.docs.json.MyContainer] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + com.thesamet.docs.json.MyContainer( + myAny = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.any.Any]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = JsonProto.javaDescriptor.getMessageTypes().get(1) def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = JsonProto.scalaDescriptor.messages(1) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = { + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null - (__number: @ _root_.scala.unchecked) match { + (__number: @_root_.scala.unchecked) match { case 1 => __out = com.google.protobuf.any.Any } __out } - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = com.thesamet.docs.json.MyContainer( myAny = _root_.scala.None ) - implicit class MyContainerLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, com.thesamet.docs.json.MyContainer] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.thesamet.docs.json.MyContainer](_l) { - def myAny: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.any.Any] = - field(_.getMyAny)((c_, f_) => c_.copy(myAny = Option(f_))) - def optionalMyAny - : _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.any.Any]] = - field(_.myAny)((c_, f_) => c_.copy(myAny = f_)) + implicit class MyContainerLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.thesamet.docs.json.MyContainer]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.thesamet.docs.json.MyContainer](_l) { + def myAny: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.any.Any] = field(_.getMyAny)((c_, f_) => c_.copy(myAny = Option(f_))) + def optionalMyAny: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.any.Any]] = field(_.myAny)((c_, f_) => c_.copy(myAny = f_)) } final val MY_ANY_FIELD_NUMBER = 1 def of( - myAny: _root_.scala.Option[com.google.protobuf.any.Any] + myAny: _root_.scala.Option[com.google.protobuf.any.Any] ): _root_.com.thesamet.docs.json.MyContainer = _root_.com.thesamet.docs.json.MyContainer( myAny ) diff --git a/docs/src/main/scala/generated/com/thesamet/docs/json/MyMessage.scala b/docs/src/main/scala/generated/com/thesamet/docs/json/MyMessage.scala index 5911a30cf..6e1777b6e 100644 --- a/docs/src/main/scala/generated/com/thesamet/docs/json/MyMessage.scala +++ b/docs/src/main/scala/generated/com/thesamet/docs/json/MyMessage.scala @@ -9,74 +9,67 @@ package com.thesamet.docs.json final case class MyMessage( x: _root_.scala.Int = 0, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[MyMessage] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = x - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MyMessage] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = x + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = x - if (__v != 0) { - _output__.writeInt32(1, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - unknownFields.writeTo(_output__) - } - def withX(__v: _root_.scala.Int): MyMessage = copy(x = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = x - if (__t != 0) __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = x + if (__v != 0) { + _output__.writeInt32(1, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withX(__v: _root_.scala.Int): MyMessage = copy(x = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = x + if (__t != 0) __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PInt(x) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PInt(x) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: com.thesamet.docs.json.MyMessage.type = com.thesamet.docs.json.MyMessage - // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyMessage]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: com.thesamet.docs.json.MyMessage.type = com.thesamet.docs.json.MyMessage + // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyMessage]) } object MyMessage extends scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyMessage] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyMessage] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): com.thesamet.docs.json.MyMessage = { - var __x: _root_.scala.Int = 0 - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.thesamet.docs.json.MyMessage] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.thesamet.docs.json.MyMessage = { + var __x: _root_.scala.Int = 0 + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -91,51 +84,32 @@ object MyMessage extends scalapb.GeneratedMessageCompanion[com.thesamet.docs.jso } } com.thesamet.docs.json.MyMessage( - x = __x, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + x = __x, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[com.thesamet.docs.json.MyMessage] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - com.thesamet.docs.json.MyMessage( - x = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Int]) - .getOrElse(0) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - JsonProto.javaDescriptor.getMessageTypes().get(0) + implicit def messageReads: _root_.scalapb.descriptors.Reads[com.thesamet.docs.json.MyMessage] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + com.thesamet.docs.json.MyMessage( + x = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = JsonProto.javaDescriptor.getMessageTypes().get(0) def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = JsonProto.scalaDescriptor.messages(0) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = com.thesamet.docs.json.MyMessage( x = 0 ) - implicit class MyMessageLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, com.thesamet.docs.json.MyMessage] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.thesamet.docs.json.MyMessage](_l) { - def x: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = - field(_.x)((c_, f_) => c_.copy(x = f_)) + implicit class MyMessageLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.thesamet.docs.json.MyMessage]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.thesamet.docs.json.MyMessage](_l) { + def x: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.x)((c_, f_) => c_.copy(x = f_)) } final val X_FIELD_NUMBER = 1 def of( - x: _root_.scala.Int + x: _root_.scala.Int ): _root_.com.thesamet.docs.json.MyMessage = _root_.com.thesamet.docs.json.MyMessage( x ) diff --git a/docs/src/main/scala/generated/mytypes/duration/Duration.scala b/docs/src/main/scala/generated/mytypes/duration/Duration.scala index e35dfefed..7c931f9e1 100644 --- a/docs/src/main/scala/generated/mytypes/duration/Duration.scala +++ b/docs/src/main/scala/generated/mytypes/duration/Duration.scala @@ -9,73 +9,67 @@ package mytypes.duration final case class Duration( seconds: _root_.scala.Int = 0, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[Duration] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = seconds - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Duration] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = seconds + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = seconds - if (__v != 0) { - _output__.writeInt32(1, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - unknownFields.writeTo(_output__) - } - def withSeconds(__v: _root_.scala.Int): Duration = copy(seconds = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = seconds - if (__t != 0) __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = seconds + if (__v != 0) { + _output__.writeInt32(1, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withSeconds(__v: _root_.scala.Int): Duration = copy(seconds = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = seconds + if (__t != 0) __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PInt(seconds) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PInt(seconds) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: mytypes.duration.Duration.type = mytypes.duration.Duration - // @@protoc_insertion_point(GeneratedMessage[mytypes.Duration]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: mytypes.duration.Duration.type = mytypes.duration.Duration + // @@protoc_insertion_point(GeneratedMessage[mytypes.Duration]) } object Duration extends scalapb.GeneratedMessageCompanion[mytypes.duration.Duration] { implicit def messageCompanion: scalapb.GeneratedMessageCompanion[mytypes.duration.Duration] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): mytypes.duration.Duration = { - var __seconds: _root_.scala.Int = 0 - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): mytypes.duration.Duration = { + var __seconds: _root_.scala.Int = 0 + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -90,52 +84,32 @@ object Duration extends scalapb.GeneratedMessageCompanion[mytypes.duration.Durat } } mytypes.duration.Duration( - seconds = __seconds, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + seconds = __seconds, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[mytypes.duration.Duration] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - mytypes.duration.Duration( - seconds = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Int]) - .getOrElse(0) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - DurationProto.javaDescriptor.getMessageTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - DurationProto.scalaDescriptor.messages(0) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + implicit def messageReads: _root_.scalapb.descriptors.Reads[mytypes.duration.Duration] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + mytypes.duration.Duration( + seconds = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = DurationProto.javaDescriptor.getMessageTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = DurationProto.scalaDescriptor.messages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = mytypes.duration.Duration( seconds = 0 ) - implicit class DurationLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, mytypes.duration.Duration] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, mytypes.duration.Duration](_l) { - def seconds: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = - field(_.seconds)((c_, f_) => c_.copy(seconds = f_)) + implicit class DurationLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, mytypes.duration.Duration]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, mytypes.duration.Duration](_l) { + def seconds: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.seconds)((c_, f_) => c_.copy(seconds = f_)) } final val SECONDS_FIELD_NUMBER = 1 def of( - seconds: _root_.scala.Int + seconds: _root_.scala.Int ): _root_.mytypes.duration.Duration = _root_.mytypes.duration.Duration( seconds ) diff --git a/docs/src/main/scala/generated/mytypes/duration/DurationProto.scala b/docs/src/main/scala/generated/mytypes/duration/DurationProto.scala index 8173e2ba6..8d0a2b842 100644 --- a/docs/src/main/scala/generated/mytypes/duration/DurationProto.scala +++ b/docs/src/main/scala/generated/mytypes/duration/DurationProto.scala @@ -9,37 +9,25 @@ object DurationProto extends _root_.scalapb.GeneratedFileObject { lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq( scalapb.options.ScalapbProto ) - lazy val messagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( mytypes.duration.Duration ) private lazy val ProtoBytes: _root_.scala.Array[Byte] = - scalapb.Encoding.fromBase64( - scala.collection.immutable - .Seq( - """Cg5kdXJhdGlvbi5wcm90bxIHbXl0eXBlcxoVc2NhbGFwYi9zY2FsYXBiLnByb3RvIk8KCER1cmF0aW9uEiYKB3NlY29uZHMYA + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """Cg5kdXJhdGlvbi5wcm90bxIHbXl0eXBlcxoVc2NhbGFwYi9zY2FsYXBiLnByb3RvIk8KCER1cmF0aW9uEiYKB3NlY29uZHMYA SABKAVCDOI/CRIHc2Vjb25kc1IHc2Vjb25kczob4j8YIhZteXR5cGVzLk15RHVyYXRpb25UeXBlYgZwcm90bzM=""" - ) - .mkString - ) + ).mkString) lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) - _root_.scalapb.descriptors.FileDescriptor - .buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) } lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) - com.google.protobuf.Descriptors.FileDescriptor.buildFrom( - javaProto, - _root_.scala.Array( - scalapb.options.ScalapbProto.javaDescriptor - ) - ) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + scalapb.options.ScalapbProto.javaDescriptor + )) } - @deprecated( - "Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", - "ScalaPB 0.5.47" - ) + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor -} +} \ No newline at end of file diff --git a/docs/src/main/scala/generated/scalapb/docs/person/Person.scala b/docs/src/main/scala/generated/scalapb/docs/person/Person.scala index ce57e8bd9..517c1a6d6 100644 --- a/docs/src/main/scala/generated/scalapb/docs/person/Person.scala +++ b/docs/src/main/scala/generated/scalapb/docs/person/Person.scala @@ -11,116 +11,104 @@ final case class Person( age: _root_.scala.Int = 0, addresses: _root_.scala.Seq[scalapb.docs.person.Person.Address] = _root_.scala.Seq.empty, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[Person] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = name - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Person] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = name + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = age + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value) + } + }; + addresses.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize } - }; - - { - val __value = age - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value) + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - addresses.foreach { __item => - val __value = __item - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + __size - 1 + } - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = name + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = age + if (__v != 0) { + _output__.writeInt32(2, __v) + } + }; + addresses.foreach { __v => + val __m = __v + _output__.writeTag(3, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = name - if (!__v.isEmpty) { - _output__.writeString(1, __v) - } - }; - { - val __v = age - if (__v != 0) { - _output__.writeInt32(2, __v) - } - }; - addresses.foreach { __v => - val __m = __v - _output__.writeTag(3, 2) - _output__.writeUInt32NoTag(__m.serializedSize) - __m.writeTo(_output__) - }; - unknownFields.writeTo(_output__) - } - def withName(__v: _root_.scala.Predef.String): Person = copy(name = __v) - def withAge(__v: _root_.scala.Int): Person = copy(age = __v) - def clearAddresses = copy(addresses = _root_.scala.Seq.empty) - def addAddresses(__vs: scalapb.docs.person.Person.Address*): Person = addAllAddresses(__vs) - def addAllAddresses(__vs: Iterable[scalapb.docs.person.Person.Address]): Person = - copy(addresses = addresses ++ __vs) - def withAddresses(__v: _root_.scala.Seq[scalapb.docs.person.Person.Address]): Person = - copy(addresses = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = name - if (__t != "") __t else null - } - case 2 => { - val __t = age - if (__t != 0) __t else null + def withName(__v: _root_.scala.Predef.String): Person = copy(name = __v) + def withAge(__v: _root_.scala.Int): Person = copy(age = __v) + def clearAddresses = copy(addresses = _root_.scala.Seq.empty) + def addAddresses(__vs: scalapb.docs.person.Person.Address *): Person = addAllAddresses(__vs) + def addAllAddresses(__vs: Iterable[scalapb.docs.person.Person.Address]): Person = copy(addresses = addresses ++ __vs) + def withAddresses(__v: _root_.scala.Seq[scalapb.docs.person.Person.Address]): Person = copy(addresses = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = name + if (__t != "") __t else null + } + case 2 => { + val __t = age + if (__t != 0) __t else null + } + case 3 => addresses } - case 3 => addresses } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PString(name) - case 2 => _root_.scalapb.descriptors.PInt(age) - case 3 => _root_.scalapb.descriptors.PRepeated(addresses.iterator.map(_.toPMessage).toVector) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(name) + case 2 => _root_.scalapb.descriptors.PInt(age) + case 3 => _root_.scalapb.descriptors.PRepeated(addresses.iterator.map(_.toPMessage).toVector) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.docs.person.Person.type = scalapb.docs.person.Person - // @@protoc_insertion_point(GeneratedMessage[scalapb.docs.Person]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.docs.person.Person.type = scalapb.docs.person.Person + // @@protoc_insertion_point(GeneratedMessage[scalapb.docs.Person]) } object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person] { - implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person] = - this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.docs.person.Person = { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.docs.person.Person = { var __name: _root_.scala.Predef.String = "" - var __age: _root_.scala.Int = 0 - val __addresses - : _root_.scala.collection.immutable.VectorBuilder[scalapb.docs.person.Person.Address] = - new _root_.scala.collection.immutable.VectorBuilder[scalapb.docs.person.Person.Address] - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + var __age: _root_.scala.Int = 0 + val __addresses: _root_.scala.collection.immutable.VectorBuilder[scalapb.docs.person.Person.Address] = new _root_.scala.collection.immutable.VectorBuilder[scalapb.docs.person.Person.Address] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -130,8 +118,7 @@ object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Pers case 16 => __age = _input__.readInt32() case 26 => - __addresses += _root_.scalapb.LiteParser - .readMessage[scalapb.docs.person.Person.Address](_input__) + __addresses += _root_.scalapb.LiteParser.readMessage[scalapb.docs.person.Person.Address](_input__) case tag => if (_unknownFields__ == null) { _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() @@ -140,225 +127,185 @@ object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Pers } } scalapb.docs.person.Person( - name = __name, - age = __age, - addresses = __addresses.result(), - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + name = __name, + age = __age, + addresses = __addresses.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.docs.person.Person] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.docs.person.Person( - name = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Predef.String]) - .getOrElse(""), - age = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(2).get) - .map(_.as[_root_.scala.Int]) - .getOrElse(0), - addresses = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(3).get) - .map(_.as[_root_.scala.Seq[scalapb.docs.person.Person.Address]]) - .getOrElse(_root_.scala.Seq.empty) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - PersonProto.javaDescriptor.getMessageTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - PersonProto.scalaDescriptor.messages(0) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.docs.person.Person] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.docs.person.Person( + name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + age = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Int]).getOrElse(0), + addresses = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[scalapb.docs.person.Person.Address]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = PersonProto.javaDescriptor.getMessageTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = PersonProto.scalaDescriptor.messages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null - (__number: @ _root_.scala.unchecked) match { + (__number: @_root_.scala.unchecked) match { case 3 => __out = scalapb.docs.person.Person.Address } __out } - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( _root_.scalapb.docs.person.Person.Address ) - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = scalapb.docs.person.Person( name = "", age = 0, addresses = _root_.scala.Seq.empty ) - sealed abstract class AddressType(val value: _root_.scala.Int) - extends _root_.scalapb.GeneratedEnum { + sealed abstract class AddressType(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum { type EnumType = AddressType def isHome: _root_.scala.Boolean = false def isWork: _root_.scala.Boolean = false - def companion: _root_.scalapb.GeneratedEnumCompanion[AddressType] = - scalapb.docs.person.Person.AddressType - final def asRecognized: _root_.scala.Option[scalapb.docs.person.Person.AddressType.Recognized] = - if (isUnrecognized) _root_.scala.None - else _root_.scala.Some(this.asInstanceOf[scalapb.docs.person.Person.AddressType.Recognized]) + def companion: _root_.scalapb.GeneratedEnumCompanion[AddressType] = scalapb.docs.person.Person.AddressType + final def asRecognized: _root_.scala.Option[scalapb.docs.person.Person.AddressType.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[scalapb.docs.person.Person.AddressType.Recognized]) } - + object AddressType extends _root_.scalapb.GeneratedEnumCompanion[AddressType] { sealed trait Recognized extends AddressType implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[AddressType] = this - + @SerialVersionUID(0L) case object HOME extends AddressType(0) with AddressType.Recognized { - val index = 0 - val name = "HOME" + val index = 0 + val name = "HOME" override def isHome: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) case object WORK extends AddressType(1) with AddressType.Recognized { - val index = 1 - val name = "WORK" + val index = 1 + val name = "WORK" override def isWork: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) - final case class Unrecognized(unrecognizedValue: _root_.scala.Int) - extends AddressType(unrecognizedValue) - with _root_.scalapb.UnrecognizedEnum + final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends AddressType(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum lazy val values = scala.collection.immutable.Seq(HOME, WORK) def fromValue(__value: _root_.scala.Int): AddressType = __value match { - case 0 => HOME - case 1 => WORK + case 0 => HOME + case 1 => WORK case __other => Unrecognized(__other) } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = - scalapb.docs.person.Person.javaDescriptor.getEnumTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = - scalapb.docs.person.Person.scalaDescriptor.enums(0) + def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = scalapb.docs.person.Person.javaDescriptor.getEnumTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = scalapb.docs.person.Person.scalaDescriptor.enums(0) } @SerialVersionUID(0L) final case class Address( - addressType: scalapb.docs.person.Person.AddressType = - scalapb.docs.person.Person.AddressType.HOME, + addressType: scalapb.docs.person.Person.AddressType = scalapb.docs.person.Person.AddressType.HOME, street: _root_.scala.Predef.String = "", city: _root_.scala.Predef.String = "", unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty - ) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[Address] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = addressType.value - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value) - } - }; - - { - val __value = street - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) - } - }; - - { - val __value = city - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Address] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = addressType.value + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value) + } + }; + + { + val __value = street + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = city + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = addressType.value - if (__v != 0) { - _output__.writeEnum(1, __v) - } - }; - { - val __v = street - if (!__v.isEmpty) { - _output__.writeString(2, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - { - val __v = city - if (!__v.isEmpty) { - _output__.writeString(3, __v) - } - }; - unknownFields.writeTo(_output__) - } - def withAddressType(__v: scalapb.docs.person.Person.AddressType): Address = - copy(addressType = __v) - def withStreet(__v: _root_.scala.Predef.String): Address = copy(street = __v) - def withCity(__v: _root_.scala.Predef.String): Address = copy(city = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = addressType.javaValueDescriptor - if (__t.getNumber() != 0) __t else null - } - case 2 => { - val __t = street - if (__t != "") __t else null - } - case 3 => { - val __t = city - if (__t != "") __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = addressType.value + if (__v != 0) { + _output__.writeEnum(1, __v) + } + }; + { + val __v = street + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = city + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withAddressType(__v: scalapb.docs.person.Person.AddressType): Address = copy(addressType = __v) + def withStreet(__v: _root_.scala.Predef.String): Address = copy(street = __v) + def withCity(__v: _root_.scala.Predef.String): Address = copy(city = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = addressType.javaValueDescriptor + if (__t.getNumber() != 0) __t else null + } + case 2 => { + val __t = street + if (__t != "") __t else null + } + case 3 => { + val __t = city + if (__t != "") __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PEnum(addressType.scalaValueDescriptor) - case 2 => _root_.scalapb.descriptors.PString(street) - case 3 => _root_.scalapb.descriptors.PString(city) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PEnum(addressType.scalaValueDescriptor) + case 2 => _root_.scalapb.descriptors.PString(street) + case 3 => _root_.scalapb.descriptors.PString(city) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.docs.person.Person.Address.type = scalapb.docs.person.Person.Address - // @@protoc_insertion_point(GeneratedMessage[scalapb.docs.Person.Address]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.docs.person.Person.Address.type = scalapb.docs.person.Person.Address + // @@protoc_insertion_point(GeneratedMessage[scalapb.docs.Person.Address]) } - + object Address extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person.Address] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person.Address] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.docs.person.Person.Address = { - var __addressType: scalapb.docs.person.Person.AddressType = - scalapb.docs.person.Person.AddressType.HOME - var __street: _root_.scala.Predef.String = "" - var __city: _root_.scala.Predef.String = "" - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.docs.person.Person.Address] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.docs.person.Person.Address = { + var __addressType: scalapb.docs.person.Person.AddressType = scalapb.docs.person.Person.AddressType.HOME + var __street: _root_.scala.Predef.String = "" + var __city: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -377,55 +324,28 @@ object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Pers } } scalapb.docs.person.Person.Address( - addressType = __addressType, - street = __street, - city = __city, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + addressType = __addressType, + street = __street, + city = __city, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads - : _root_.scalapb.descriptors.Reads[scalapb.docs.person.Person.Address] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.docs.person.Person.Address( - addressType = scalapb.docs.person.Person.AddressType.fromValue( - __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]) - .getOrElse(scalapb.docs.person.Person.AddressType.HOME.scalaValueDescriptor) - .number - ), - street = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(2).get) - .map(_.as[_root_.scala.Predef.String]) - .getOrElse(""), - city = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(3).get) - .map(_.as[_root_.scala.Predef.String]) - .getOrElse("") - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - scalapb.docs.person.Person.javaDescriptor.getNestedTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - scalapb.docs.person.Person.scalaDescriptor.nestedMessages(0) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = { - (__fieldNumber: @ _root_.scala.unchecked) match { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.docs.person.Person.Address] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.docs.person.Person.Address( + addressType = scalapb.docs.person.Person.AddressType.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(scalapb.docs.person.Person.AddressType.HOME.scalaValueDescriptor).number), + street = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + city = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = scalapb.docs.person.Person.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = scalapb.docs.person.Person.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = { + (__fieldNumber: @_root_.scala.unchecked) match { case 1 => scalapb.docs.person.Person.AddressType } } @@ -434,23 +354,18 @@ object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Pers street = "", city = "" ) - implicit class AddressLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person.Address] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.docs.person.Person.Address](_l) { - def addressType: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person.AddressType] = - field(_.addressType)((c_, f_) => c_.copy(addressType = f_)) - def street: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = - field(_.street)((c_, f_) => c_.copy(street = f_)) - def city: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = - field(_.city)((c_, f_) => c_.copy(city = f_)) + implicit class AddressLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person.Address]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.docs.person.Person.Address](_l) { + def addressType: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person.AddressType] = field(_.addressType)((c_, f_) => c_.copy(addressType = f_)) + def street: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.street)((c_, f_) => c_.copy(street = f_)) + def city: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.city)((c_, f_) => c_.copy(city = f_)) } final val ADDRESS_TYPE_FIELD_NUMBER = 1 - final val STREET_FIELD_NUMBER = 2 - final val CITY_FIELD_NUMBER = 3 + final val STREET_FIELD_NUMBER = 2 + final val CITY_FIELD_NUMBER = 3 def of( - addressType: scalapb.docs.person.Person.AddressType, - street: _root_.scala.Predef.String, - city: _root_.scala.Predef.String + addressType: scalapb.docs.person.Person.AddressType, + street: _root_.scala.Predef.String, + city: _root_.scala.Predef.String ): _root_.scalapb.docs.person.Person.Address = _root_.scalapb.docs.person.Person.Address( addressType, street, @@ -458,25 +373,19 @@ object Person extends scalapb.GeneratedMessageCompanion[scalapb.docs.person.Pers ) // @@protoc_insertion_point(GeneratedMessageCompanion[scalapb.docs.Person.Address]) } - - implicit class PersonLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.docs.person.Person](_l) { - def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = - field(_.name)((c_, f_) => c_.copy(name = f_)) - def age: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = - field(_.age)((c_, f_) => c_.copy(age = f_)) - def addresses: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[ - scalapb.docs.person.Person.Address - ]] = field(_.addresses)((c_, f_) => c_.copy(addresses = f_)) + + implicit class PersonLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.docs.person.Person]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.docs.person.Person](_l) { + def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_)) + def age: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.age)((c_, f_) => c_.copy(age = f_)) + def addresses: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[scalapb.docs.person.Person.Address]] = field(_.addresses)((c_, f_) => c_.copy(addresses = f_)) } - final val NAME_FIELD_NUMBER = 1 - final val AGE_FIELD_NUMBER = 2 + final val NAME_FIELD_NUMBER = 1 + final val AGE_FIELD_NUMBER = 2 final val ADDRESSES_FIELD_NUMBER = 3 def of( - name: _root_.scala.Predef.String, - age: _root_.scala.Int, - addresses: _root_.scala.Seq[scalapb.docs.person.Person.Address] + name: _root_.scala.Predef.String, + age: _root_.scala.Int, + addresses: _root_.scala.Seq[scalapb.docs.person.Person.Address] ): _root_.scalapb.docs.person.Person = _root_.scalapb.docs.person.Person( name, age, diff --git a/docs/src/main/scala/generated/scalapb/docs/person/PersonProto.scala b/docs/src/main/scala/generated/scalapb/docs/person/PersonProto.scala index 830138f65..2c678384e 100644 --- a/docs/src/main/scala/generated/scalapb/docs/person/PersonProto.scala +++ b/docs/src/main/scala/generated/scalapb/docs/person/PersonProto.scala @@ -7,40 +7,28 @@ package scalapb.docs.person object PersonProto extends _root_.scalapb.GeneratedFileObject { lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq.empty - lazy val messagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( scalapb.docs.person.Person ) private lazy val ProtoBytes: _root_.scala.Array[Byte] = - scalapb.Encoding.fromBase64( - scala.collection.immutable - .Seq( - """CgxwZXJzb24ucHJvdG8SDHNjYWxhcGIuZG9jcyLvAgoGUGVyc29uEh0KBG5hbWUYASABKAlCCeI/BhIEbmFtZVIEbmFtZRIaC + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """CgxwZXJzb24ucHJvdG8SDHNjYWxhcGIuZG9jcyLvAgoGUGVyc29uEh0KBG5hbWUYASABKAlCCeI/BhIEbmFtZVIEbmFtZRIaC gNhZ2UYAiABKAVCCOI/BRIDYWdlUgNhZ2USSgoJYWRkcmVzc2VzGAMgAygLMhwuc2NhbGFwYi5kb2NzLlBlcnNvbi5BZGRyZXNzQ g7iPwsSCWFkZHJlc3Nlc1IJYWRkcmVzc2VzGqQBCgdBZGRyZXNzElUKDGFkZHJlc3NfdHlwZRgBIAEoDjIgLnNjYWxhcGIuZG9jc y5QZXJzb24uQWRkcmVzc1R5cGVCEOI/DRILYWRkcmVzc1R5cGVSC2FkZHJlc3NUeXBlEiMKBnN0cmVldBgCIAEoCUIL4j8IEgZzd HJlZXRSBnN0cmVldBIdCgRjaXR5GAMgASgJQgniPwYSBGNpdHlSBGNpdHkiNwoLQWRkcmVzc1R5cGUSEwoESE9NRRAAGgniPwYSB EhPTUUSEwoEV09SSxABGgniPwYSBFdPUktiBnByb3RvMw==""" - ) - .mkString - ) + ).mkString) lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) - _root_.scalapb.descriptors.FileDescriptor - .buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) } lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) - com.google.protobuf.Descriptors.FileDescriptor.buildFrom( - javaProto, - _root_.scala.Array( - ) - ) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + )) } - @deprecated( - "Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", - "ScalaPB 0.5.47" - ) + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor -} +} \ No newline at end of file diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/Color.scala b/docs/src/main/scala/generated/scalapb/perf/protos/Color.scala index d9291bbae..f358b8a93 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/Color.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/Color.scala @@ -7,63 +7,56 @@ package scalapb.perf.protos sealed abstract class Color(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum { type EnumType = Color - def isUnknown: _root_.scala.Boolean = false - def isRed: _root_.scala.Boolean = false - def isGreen: _root_.scala.Boolean = false - def isBlue: _root_.scala.Boolean = false + def isUnknown: _root_.scala.Boolean = false + def isRed: _root_.scala.Boolean = false + def isGreen: _root_.scala.Boolean = false + def isBlue: _root_.scala.Boolean = false def companion: _root_.scalapb.GeneratedEnumCompanion[Color] = scalapb.perf.protos.Color - final def asRecognized: _root_.scala.Option[scalapb.perf.protos.Color.Recognized] = if ( - isUnrecognized - ) _root_.scala.None - else _root_.scala.Some(this.asInstanceOf[scalapb.perf.protos.Color.Recognized]) + final def asRecognized: _root_.scala.Option[scalapb.perf.protos.Color.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[scalapb.perf.protos.Color.Recognized]) } object Color extends _root_.scalapb.GeneratedEnumCompanion[Color] { sealed trait Recognized extends Color implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[Color] = this - + @SerialVersionUID(0L) case object UNKNOWN extends Color(0) with Color.Recognized { - val index = 0 - val name = "UNKNOWN" + val index = 0 + val name = "UNKNOWN" override def isUnknown: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) case object RED extends Color(1) with Color.Recognized { - val index = 1 - val name = "RED" + val index = 1 + val name = "RED" override def isRed: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) case object GREEN extends Color(2) with Color.Recognized { - val index = 2 - val name = "GREEN" + val index = 2 + val name = "GREEN" override def isGreen: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) case object BLUE extends Color(3) with Color.Recognized { - val index = 3 - val name = "BLUE" + val index = 3 + val name = "BLUE" override def isBlue: _root_.scala.Boolean = true } - + @SerialVersionUID(0L) - final case class Unrecognized(unrecognizedValue: _root_.scala.Int) - extends Color(unrecognizedValue) - with _root_.scalapb.UnrecognizedEnum + final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends Color(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum lazy val values = scala.collection.immutable.Seq(UNKNOWN, RED, GREEN, BLUE) def fromValue(__value: _root_.scala.Int): Color = __value match { - case 0 => UNKNOWN - case 1 => RED - case 2 => GREEN - case 3 => BLUE + case 0 => UNKNOWN + case 1 => RED + case 2 => GREEN + case 3 => BLUE case __other => Unrecognized(__other) } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = - ProtosProto.javaDescriptor.getEnumTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = - ProtosProto.scalaDescriptor.enums(0) -} + def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = ProtosProto.javaDescriptor.getEnumTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = ProtosProto.scalaDescriptor.enums(0) +} \ No newline at end of file diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/Enum.scala b/docs/src/main/scala/generated/scalapb/perf/protos/Enum.scala index 4403b6c8e..5d989bbdf 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/Enum.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/Enum.scala @@ -9,73 +9,67 @@ package scalapb.perf.protos final case class Enum( color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[Enum] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = color.value - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Enum] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = color.value + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = color.value - if (__v != 0) { - _output__.writeEnum(1, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - unknownFields.writeTo(_output__) - } - def withColor(__v: scalapb.perf.protos.Color): Enum = copy(color = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = color.javaValueDescriptor - if (__t.getNumber() != 0) __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = color.value + if (__v != 0) { + _output__.writeEnum(1, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withColor(__v: scalapb.perf.protos.Color): Enum = copy(color = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = color.javaValueDescriptor + if (__t.getNumber() != 0) __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PEnum(color.scalaValueDescriptor) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PEnum(color.scalaValueDescriptor) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.Enum.type = scalapb.perf.protos.Enum - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.Enum]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.Enum.type = scalapb.perf.protos.Enum + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.Enum]) } object Enum extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.Enum] { implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.Enum] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.Enum = { + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.Enum = { var __color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -90,59 +84,36 @@ object Enum extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.Enum] } } scalapb.perf.protos.Enum( - color = __color, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + color = __color, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.Enum] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.Enum( - color = scalapb.perf.protos.Color.fromValue( - __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]) - .getOrElse(scalapb.perf.protos.Color.UNKNOWN.scalaValueDescriptor) - .number - ) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(2) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(2) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = { - (__fieldNumber: @ _root_.scala.unchecked) match { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.Enum] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.Enum( + color = scalapb.perf.protos.Color.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(scalapb.perf.protos.Color.UNKNOWN.scalaValueDescriptor).number) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(2) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(2) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = { + (__fieldNumber: @_root_.scala.unchecked) match { case 1 => scalapb.perf.protos.Color } } lazy val defaultInstance = scalapb.perf.protos.Enum( color = scalapb.perf.protos.Color.UNKNOWN ) - implicit class EnumLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Enum] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.Enum](_l) { - def color: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Color] = - field(_.color)((c_, f_) => c_.copy(color = f_)) + implicit class EnumLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Enum]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.Enum](_l) { + def color: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Color] = field(_.color)((c_, f_) => c_.copy(color = f_)) } final val COLOR_FIELD_NUMBER = 1 def of( - color: scalapb.perf.protos.Color + color: scalapb.perf.protos.Color ): _root_.scalapb.perf.protos.Enum = _root_.scalapb.perf.protos.Enum( color ) diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/EnumVector.scala b/docs/src/main/scala/generated/scalapb/perf/protos/EnumVector.scala index ec710ebf5..362e96fd1 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/EnumVector.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/EnumVector.scala @@ -9,89 +9,72 @@ package scalapb.perf.protos final case class EnumVector( colors: _root_.scala.Seq[scalapb.perf.protos.Color] = _root_.scala.Seq.empty, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[EnumVector] { - private[this] def colorsSerializedSize = { - if (__colorsSerializedSizeField == 0) __colorsSerializedSizeField = { - var __s: _root_.scala.Int = 0 - colors.foreach(__i => - __s += _root_.com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(__i.value) - ) - __s + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[EnumVector] { + private[this] def colorsSerializedSize = { + if (__colorsSerializedSizeField == 0) __colorsSerializedSizeField = { + var __s: _root_.scala.Int = 0 + colors.foreach(__i => __s += _root_.com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(__i.value)) + __s + } + __colorsSerializedSizeField } - __colorsSerializedSizeField - } - @transient private[this] var __colorsSerializedSizeField: _root_.scala.Int = 0 - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - if (colors.nonEmpty) { - val __localsize = colorsSerializedSize - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__localsize) + __localsize + @transient private[this] var __colorsSerializedSizeField: _root_.scala.Int = 0 + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + if (colors.nonEmpty) { + val __localsize = colorsSerializedSize + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__localsize) + __localsize + } + __size += unknownFields.serializedSize + __size } - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - if (colors.nonEmpty) { - _output__.writeTag(1, 2) - _output__.writeUInt32NoTag(colorsSerializedSize) - colors.foreach((_output__.writeEnumNoTag _).compose((_: scalapb.perf.protos.Color).value)) - }; - unknownFields.writeTo(_output__) - } - def clearColors = copy(colors = _root_.scala.Seq.empty) - def addColors(__vs: scalapb.perf.protos.Color*): EnumVector = addAllColors(__vs) - def addAllColors(__vs: Iterable[scalapb.perf.protos.Color]): EnumVector = - copy(colors = colors ++ __vs) - def withColors(__v: _root_.scala.Seq[scalapb.perf.protos.Color]): EnumVector = copy(colors = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => colors.iterator.map(_.javaValueDescriptor).toSeq + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + if (colors.nonEmpty) { + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(colorsSerializedSize) + colors.foreach((_output__.writeEnumNoTag _).compose((_: scalapb.perf.protos.Color).value)) + }; + unknownFields.writeTo(_output__) } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => - _root_.scalapb.descriptors.PRepeated( - colors.iterator - .map(__e => _root_.scalapb.descriptors.PEnum(__e.scalaValueDescriptor)) - .toVector - ) + def clearColors = copy(colors = _root_.scala.Seq.empty) + def addColors(__vs: scalapb.perf.protos.Color *): EnumVector = addAllColors(__vs) + def addAllColors(__vs: Iterable[scalapb.perf.protos.Color]): EnumVector = copy(colors = colors ++ __vs) + def withColors(__v: _root_.scala.Seq[scalapb.perf.protos.Color]): EnumVector = copy(colors = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => colors.iterator.map(_.javaValueDescriptor).toSeq + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.EnumVector.type = scalapb.perf.protos.EnumVector - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.EnumVector]) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(colors.iterator.map(__e => _root_.scalapb.descriptors.PEnum(__e.scalaValueDescriptor)).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.EnumVector.type = scalapb.perf.protos.EnumVector + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.EnumVector]) } object EnumVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.EnumVector] { - implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.EnumVector] = - this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.EnumVector = { - val __colors: _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.Color] = - new _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.Color] - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.EnumVector] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.EnumVector = { + val __colors: _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.Color] = new _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.Color] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -99,7 +82,7 @@ object EnumVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos. case 8 => __colors += scalapb.perf.protos.Color.fromValue(_input__.readEnum()) case 10 => { - val length = _input__.readRawVarint32() + val length = _input__.readRawVarint32() val oldLimit = _input__.pushLimit(length) while (_input__.getBytesUntilLimit > 0) { __colors += scalapb.perf.protos.Color.fromValue(_input__.readEnum()) @@ -114,59 +97,36 @@ object EnumVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos. } } scalapb.perf.protos.EnumVector( - colors = __colors.result(), - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + colors = __colors.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.EnumVector] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.EnumVector( - colors = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Seq[_root_.scalapb.descriptors.EnumValueDescriptor]]) - .getOrElse(_root_.scala.Seq.empty) - .iterator - .map(__e => scalapb.perf.protos.Color.fromValue(__e.number)) - .toSeq - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(3) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(3) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = { - (__fieldNumber: @ _root_.scala.unchecked) match { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.EnumVector] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.EnumVector( + colors = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[_root_.scalapb.descriptors.EnumValueDescriptor]]).getOrElse(_root_.scala.Seq.empty).iterator.map(__e => scalapb.perf.protos.Color.fromValue(__e.number)).toSeq + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(3) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(3) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = { + (__fieldNumber: @_root_.scala.unchecked) match { case 1 => scalapb.perf.protos.Color } } lazy val defaultInstance = scalapb.perf.protos.EnumVector( colors = _root_.scala.Seq.empty ) - implicit class EnumVectorLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.EnumVector] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.EnumVector](_l) { - def colors: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[scalapb.perf.protos.Color]] = - field(_.colors)((c_, f_) => c_.copy(colors = f_)) + implicit class EnumVectorLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.EnumVector]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.EnumVector](_l) { + def colors: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[scalapb.perf.protos.Color]] = field(_.colors)((c_, f_) => c_.copy(colors = f_)) } final val COLORS_FIELD_NUMBER = 1 def of( - colors: _root_.scala.Seq[scalapb.perf.protos.Color] + colors: _root_.scala.Seq[scalapb.perf.protos.Color] ): _root_.scalapb.perf.protos.EnumVector = _root_.scalapb.perf.protos.EnumVector( colors ) diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/IntVector.scala b/docs/src/main/scala/generated/scalapb/perf/protos/IntVector.scala index bb28b5f0d..fe7b872ce 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/IntVector.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/IntVector.scala @@ -9,86 +9,72 @@ package scalapb.perf.protos final case class IntVector( ints: _root_.scala.Seq[_root_.scala.Int] = _root_.scala.Seq.empty, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[IntVector] { - private[this] def intsSerializedSize = { - if (__intsSerializedSizeField == 0) __intsSerializedSizeField = { - var __s: _root_.scala.Int = 0 - ints.foreach(__i => - __s += _root_.com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(__i) - ) - __s + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[IntVector] { + private[this] def intsSerializedSize = { + if (__intsSerializedSizeField == 0) __intsSerializedSizeField = { + var __s: _root_.scala.Int = 0 + ints.foreach(__i => __s += _root_.com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(__i)) + __s + } + __intsSerializedSizeField } - __intsSerializedSizeField - } - @transient private[this] var __intsSerializedSizeField: _root_.scala.Int = 0 - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - if (ints.nonEmpty) { - val __localsize = intsSerializedSize - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__localsize) + __localsize + @transient private[this] var __intsSerializedSizeField: _root_.scala.Int = 0 + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + if (ints.nonEmpty) { + val __localsize = intsSerializedSize + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__localsize) + __localsize + } + __size += unknownFields.serializedSize + __size } - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - if (ints.nonEmpty) { - _output__.writeTag(1, 2) - _output__.writeUInt32NoTag(intsSerializedSize) - ints.foreach(_output__.writeInt32NoTag) - }; - unknownFields.writeTo(_output__) - } - def clearInts = copy(ints = _root_.scala.Seq.empty) - def addInts(__vs: _root_.scala.Int*): IntVector = addAllInts(__vs) - def addAllInts(__vs: Iterable[_root_.scala.Int]): IntVector = copy(ints = ints ++ __vs) - def withInts(__v: _root_.scala.Seq[_root_.scala.Int]): IntVector = copy(ints = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => ints + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + if (ints.nonEmpty) { + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(intsSerializedSize) + ints.foreach(_output__.writeInt32NoTag) + }; + unknownFields.writeTo(_output__) } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => - _root_.scalapb.descriptors.PRepeated( - ints.iterator.map(_root_.scalapb.descriptors.PInt(_)).toVector - ) + def clearInts = copy(ints = _root_.scala.Seq.empty) + def addInts(__vs: _root_.scala.Int *): IntVector = addAllInts(__vs) + def addAllInts(__vs: Iterable[_root_.scala.Int]): IntVector = copy(ints = ints ++ __vs) + def withInts(__v: _root_.scala.Seq[_root_.scala.Int]): IntVector = copy(ints = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => ints + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.IntVector.type = scalapb.perf.protos.IntVector - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.IntVector]) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(ints.iterator.map(_root_.scalapb.descriptors.PInt(_)).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.IntVector.type = scalapb.perf.protos.IntVector + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.IntVector]) } object IntVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.IntVector] { - implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.IntVector] = - this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.IntVector = { - val __ints: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] = - new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.IntVector] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.IntVector = { + val __ints: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Int] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -96,7 +82,7 @@ object IntVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.I case 8 => __ints += _input__.readInt32() case 10 => { - val length = _input__.readRawVarint32() + val length = _input__.readRawVarint32() val oldLimit = _input__.pushLimit(length) while (_input__.getBytesUntilLimit > 0) { __ints += _input__.readInt32() @@ -111,52 +97,32 @@ object IntVector extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.I } } scalapb.perf.protos.IntVector( - ints = __ints.result(), - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + ints = __ints.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.IntVector] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.IntVector( - ints = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Seq[_root_.scala.Int]]) - .getOrElse(_root_.scala.Seq.empty) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(4) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(4) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.IntVector] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.IntVector( + ints = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[_root_.scala.Int]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(4) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(4) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = scalapb.perf.protos.IntVector( ints = _root_.scala.Seq.empty ) - implicit class IntVectorLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.IntVector] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.IntVector](_l) { - def ints: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Int]] = - field(_.ints)((c_, f_) => c_.copy(ints = f_)) + implicit class IntVectorLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.IntVector]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.IntVector](_l) { + def ints: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Int]] = field(_.ints)((c_, f_) => c_.copy(ints = f_)) } final val INTS_FIELD_NUMBER = 1 def of( - ints: _root_.scala.Seq[_root_.scala.Int] + ints: _root_.scala.Seq[_root_.scala.Int] ): _root_.scalapb.perf.protos.IntVector = _root_.scalapb.perf.protos.IntVector( ints ) diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/MessageContainer.scala b/docs/src/main/scala/generated/scalapb/perf/protos/MessageContainer.scala index 1e5b5fa0e..6101e6ba0 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/MessageContainer.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/MessageContainer.scala @@ -6,114 +6,95 @@ package scalapb.perf.protos /** @param rep - * [(scalapb.field).collection_type="List"]; + * [(scalapb.field).collection_type="List"]; */ @SerialVersionUID(0L) final case class MessageContainer( opt: _root_.scala.Option[scalapb.perf.protos.SimpleMessage] = _root_.scala.None, rep: _root_.scala.Seq[scalapb.perf.protos.SimpleMessage] = _root_.scala.Seq.empty, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[MessageContainer] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - if (opt.isDefined) { - val __value = opt.get - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize - }; - rep.foreach { __item => - val __value = __item - __size += 1 + _root_.com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MessageContainer] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + if (opt.isDefined) { + val __value = opt.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + rep.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size } - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - opt.foreach { __v => - val __m = __v - _output__.writeTag(1, 2) - _output__.writeUInt32NoTag(__m.serializedSize) - __m.writeTo(_output__) - }; - rep.foreach { __v => - val __m = __v - _output__.writeTag(2, 2) - _output__.writeUInt32NoTag(__m.serializedSize) - __m.writeTo(_output__) - }; - unknownFields.writeTo(_output__) - } - def getOpt: scalapb.perf.protos.SimpleMessage = - opt.getOrElse(scalapb.perf.protos.SimpleMessage.defaultInstance) - def clearOpt: MessageContainer = copy(opt = _root_.scala.None) - def withOpt(__v: scalapb.perf.protos.SimpleMessage): MessageContainer = copy(opt = Option(__v)) - def clearRep = copy(rep = _root_.scala.Seq.empty) - def addRep(__vs: scalapb.perf.protos.SimpleMessage*): MessageContainer = addAllRep(__vs) - def addAllRep(__vs: Iterable[scalapb.perf.protos.SimpleMessage]): MessageContainer = - copy(rep = rep ++ __vs) - def withRep(__v: _root_.scala.Seq[scalapb.perf.protos.SimpleMessage]): MessageContainer = - copy(rep = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => opt.orNull - case 2 => rep + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + opt.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + rep.foreach { __v => + val __m = __v + _output__.writeTag(2, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => opt.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) - case 2 => _root_.scalapb.descriptors.PRepeated(rep.iterator.map(_.toPMessage).toVector) + def getOpt: scalapb.perf.protos.SimpleMessage = opt.getOrElse(scalapb.perf.protos.SimpleMessage.defaultInstance) + def clearOpt: MessageContainer = copy(opt = _root_.scala.None) + def withOpt(__v: scalapb.perf.protos.SimpleMessage): MessageContainer = copy(opt = Option(__v)) + def clearRep = copy(rep = _root_.scala.Seq.empty) + def addRep(__vs: scalapb.perf.protos.SimpleMessage *): MessageContainer = addAllRep(__vs) + def addAllRep(__vs: Iterable[scalapb.perf.protos.SimpleMessage]): MessageContainer = copy(rep = rep ++ __vs) + def withRep(__v: _root_.scala.Seq[scalapb.perf.protos.SimpleMessage]): MessageContainer = copy(rep = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => opt.orNull + case 2 => rep + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.MessageContainer.type = scalapb.perf.protos.MessageContainer - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.MessageContainer]) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => opt.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 2 => _root_.scalapb.descriptors.PRepeated(rep.iterator.map(_.toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.MessageContainer.type = scalapb.perf.protos.MessageContainer + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.MessageContainer]) } -object MessageContainer - extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.MessageContainer] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[scalapb.perf.protos.MessageContainer] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.MessageContainer = { +object MessageContainer extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.MessageContainer] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.MessageContainer] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.MessageContainer = { var __opt: _root_.scala.Option[scalapb.perf.protos.SimpleMessage] = _root_.scala.None - val __rep: _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.SimpleMessage] = - new _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.SimpleMessage] - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + val __rep: _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.SimpleMessage] = new _root_.scala.collection.immutable.VectorBuilder[scalapb.perf.protos.SimpleMessage] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { case 0 => _done__ = true case 10 => - __opt = Option( - __opt.fold( - _root_.scalapb.LiteParser.readMessage[scalapb.perf.protos.SimpleMessage](_input__) - )(_root_.scalapb.LiteParser.readMessage(_input__, _)) - ) + __opt = Option(__opt.fold(_root_.scalapb.LiteParser.readMessage[scalapb.perf.protos.SimpleMessage](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) case 18 => - __rep += _root_.scalapb.LiteParser - .readMessage[scalapb.perf.protos.SimpleMessage](_input__) + __rep += _root_.scalapb.LiteParser.readMessage[scalapb.perf.protos.SimpleMessage](_input__) case tag => if (_unknownFields__ == null) { _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() @@ -122,73 +103,46 @@ object MessageContainer } } scalapb.perf.protos.MessageContainer( - opt = __opt, - rep = __rep.result(), - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + opt = __opt, + rep = __rep.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads - : _root_.scalapb.descriptors.Reads[scalapb.perf.protos.MessageContainer] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.MessageContainer( - opt = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .flatMap(_.as[_root_.scala.Option[scalapb.perf.protos.SimpleMessage]]), - rep = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(2).get) - .map(_.as[_root_.scala.Seq[scalapb.perf.protos.SimpleMessage]]) - .getOrElse(_root_.scala.Seq.empty) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(1) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(1) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.MessageContainer] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.MessageContainer( + opt = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[scalapb.perf.protos.SimpleMessage]]), + rep = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[scalapb.perf.protos.SimpleMessage]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(1) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(1) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null - (__number: @ _root_.scala.unchecked) match { + (__number: @_root_.scala.unchecked) match { case 1 => __out = scalapb.perf.protos.SimpleMessage case 2 => __out = scalapb.perf.protos.SimpleMessage } __out } - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = scalapb.perf.protos.MessageContainer( opt = _root_.scala.None, rep = _root_.scala.Seq.empty ) - implicit class MessageContainerLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.MessageContainer] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.MessageContainer](_l) { - def opt: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.SimpleMessage] = - field(_.getOpt)((c_, f_) => c_.copy(opt = Option(f_))) - def optionalOpt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[ - scalapb.perf.protos.SimpleMessage - ]] = field(_.opt)((c_, f_) => c_.copy(opt = f_)) - def rep - : _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[scalapb.perf.protos.SimpleMessage]] = - field(_.rep)((c_, f_) => c_.copy(rep = f_)) + implicit class MessageContainerLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.MessageContainer]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.MessageContainer](_l) { + def opt: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.SimpleMessage] = field(_.getOpt)((c_, f_) => c_.copy(opt = Option(f_))) + def optionalOpt: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[scalapb.perf.protos.SimpleMessage]] = field(_.opt)((c_, f_) => c_.copy(opt = f_)) + def rep: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[scalapb.perf.protos.SimpleMessage]] = field(_.rep)((c_, f_) => c_.copy(rep = f_)) } final val OPT_FIELD_NUMBER = 1 final val REP_FIELD_NUMBER = 2 def of( - opt: _root_.scala.Option[scalapb.perf.protos.SimpleMessage], - rep: _root_.scala.Seq[scalapb.perf.protos.SimpleMessage] + opt: _root_.scala.Option[scalapb.perf.protos.SimpleMessage], + rep: _root_.scala.Seq[scalapb.perf.protos.SimpleMessage] ): _root_.scalapb.perf.protos.MessageContainer = _root_.scalapb.perf.protos.MessageContainer( opt, rep diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/ProtosProto.scala b/docs/src/main/scala/generated/scalapb/perf/protos/ProtosProto.scala index cbd414173..ee3bd46fb 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/ProtosProto.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/ProtosProto.scala @@ -9,8 +9,7 @@ object ProtosProto extends _root_.scalapb.GeneratedFileObject { lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq( scalapb.options.ScalapbProto ) - lazy val messagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( scalapb.perf.protos.SimpleMessage, scalapb.perf.protos.MessageContainer, @@ -20,10 +19,8 @@ object ProtosProto extends _root_.scalapb.GeneratedFileObject { scalapb.perf.protos.StringMessage ) private lazy val ProtoBytes: _root_.scala.Array[Byte] = - scalapb.Encoding.fromBase64( - scala.collection.immutable - .Seq( - """Cgxwcm90b3MucHJvdG8SDHNjYWxhcGIucGVyZhoVc2NhbGFwYi9zY2FsYXBiLnByb3RvIogBCg1TaW1wbGVNZXNzYWdlEhQKA + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """Cgxwcm90b3MucHJvdG8SDHNjYWxhcGIucGVyZhoVc2NhbGFwYi9zY2FsYXBiLnByb3RvIogBCg1TaW1wbGVNZXNzYWdlEhQKA WkYASABKAVCBuI/AxIBaVIBaRIUCgFqGAIgASgFQgbiPwMSAWpSAWoSFAoBaxgDIAEoDEIG4j8DEgFrUgFrEjUKBWNvbG9yGAQgA SgOMhMuc2NhbGFwYi5wZXJmLkNvbG9yQgriPwcSBWNvbG9yUgVjb2xvciKEAQoQTWVzc2FnZUNvbnRhaW5lchI3CgNvcHQYASABK AsyGy5zY2FsYXBiLnBlcmYuU2ltcGxlTWVzc2FnZUII4j8FEgNvcHRSA29wdBI3CgNyZXAYAiADKAsyGy5zY2FsYXBiLnBlcmYuU @@ -47,26 +44,17 @@ object ProtosProto extends _root_.scalapb.GeneratedFileObject { AESAyYIEQoLCgQEBAIAEgMnAhoKDAoFBAQCAAQSAycCCgoMCgUEBAIABRIDJwsQCgwKBQQEAgABEgMnERUKDAoFBAQCAAMSAycYG QoKCgIEBRIEKgAtAQoKCgMEBQESAyoIFQoLCgQEBQIAEgMrAhIKDAoFBAUCAAUSAysCCAoMCgUEBQIAARIDKwkNCgwKBQQFAgADE gMrEBEKCwoEBAUCARIDLAISCgwKBQQFAgEFEgMsAggKDAoFBAUCAQESAywJDQoMCgUEBQIBAxIDLBARYgZwcm90bzM=""" - ) - .mkString - ) + ).mkString) lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) - _root_.scalapb.descriptors.FileDescriptor - .buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) } lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) - com.google.protobuf.Descriptors.FileDescriptor.buildFrom( - javaProto, - _root_.scala.Array( - scalapb.options.ScalapbProto.javaDescriptor - ) - ) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + scalapb.options.ScalapbProto.javaDescriptor + )) } - @deprecated( - "Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", - "ScalaPB 0.5.47" - ) + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor -} +} \ No newline at end of file diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/SimpleMessage.scala b/docs/src/main/scala/generated/scalapb/perf/protos/SimpleMessage.scala index 29245e623..369200a81 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/SimpleMessage.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/SimpleMessage.scala @@ -12,134 +12,127 @@ final case class SimpleMessage( k: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY, color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[SimpleMessage] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = i - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) - } - }; - - { - val __value = j - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value) - } - }; - - { - val __value = k - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(3, __value) - } - }; - - { - val __value = color.value - if (__value != 0) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(4, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[SimpleMessage] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = i + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(1, __value) + } + }; + + { + val __value = j + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value) + } + }; + + { + val __value = k + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(3, __value) + } + }; + + { + val __value = color.value + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(4, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = i - if (__v != 0) { - _output__.writeInt32(1, __v) - } - }; - { - val __v = j - if (__v != 0) { - _output__.writeInt32(2, __v) - } - }; - { - val __v = k - if (!__v.isEmpty) { - _output__.writeBytes(3, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - { - val __v = color.value - if (__v != 0) { - _output__.writeEnum(4, __v) - } - }; - unknownFields.writeTo(_output__) - } - def withI(__v: _root_.scala.Int): SimpleMessage = copy(i = __v) - def withJ(__v: _root_.scala.Int): SimpleMessage = copy(j = __v) - def withK(__v: _root_.com.google.protobuf.ByteString): SimpleMessage = copy(k = __v) - def withColor(__v: scalapb.perf.protos.Color): SimpleMessage = copy(color = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = i - if (__t != 0) __t else null - } - case 2 => { - val __t = j - if (__t != 0) __t else null - } - case 3 => { - val __t = k - if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null - } - case 4 => { - val __t = color.javaValueDescriptor - if (__t.getNumber() != 0) __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = i + if (__v != 0) { + _output__.writeInt32(1, __v) + } + }; + { + val __v = j + if (__v != 0) { + _output__.writeInt32(2, __v) + } + }; + { + val __v = k + if (!__v.isEmpty) { + _output__.writeBytes(3, __v) + } + }; + { + val __v = color.value + if (__v != 0) { + _output__.writeEnum(4, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withI(__v: _root_.scala.Int): SimpleMessage = copy(i = __v) + def withJ(__v: _root_.scala.Int): SimpleMessage = copy(j = __v) + def withK(__v: _root_.com.google.protobuf.ByteString): SimpleMessage = copy(k = __v) + def withColor(__v: scalapb.perf.protos.Color): SimpleMessage = copy(color = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = i + if (__t != 0) __t else null + } + case 2 => { + val __t = j + if (__t != 0) __t else null + } + case 3 => { + val __t = k + if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null + } + case 4 => { + val __t = color.javaValueDescriptor + if (__t.getNumber() != 0) __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PInt(i) - case 2 => _root_.scalapb.descriptors.PInt(j) - case 3 => _root_.scalapb.descriptors.PByteString(k) - case 4 => _root_.scalapb.descriptors.PEnum(color.scalaValueDescriptor) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PInt(i) + case 2 => _root_.scalapb.descriptors.PInt(j) + case 3 => _root_.scalapb.descriptors.PByteString(k) + case 4 => _root_.scalapb.descriptors.PEnum(color.scalaValueDescriptor) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.SimpleMessage.type = scalapb.perf.protos.SimpleMessage - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.SimpleMessage]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.SimpleMessage.type = scalapb.perf.protos.SimpleMessage + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.SimpleMessage]) } object SimpleMessage extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.SimpleMessage] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[scalapb.perf.protos.SimpleMessage] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.SimpleMessage = { - var __i: _root_.scala.Int = 0 - var __j: _root_.scala.Int = 0 + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.SimpleMessage] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.SimpleMessage = { + var __i: _root_.scala.Int = 0 + var __j: _root_.scala.Int = 0 var __k: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY - var __color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + var __color: scalapb.perf.protos.Color = scalapb.perf.protos.Color.UNKNOWN + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -160,59 +153,30 @@ object SimpleMessage extends scalapb.GeneratedMessageCompanion[scalapb.perf.prot } } scalapb.perf.protos.SimpleMessage( - i = __i, - j = __j, - k = __k, - color = __color, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + i = __i, + j = __j, + k = __k, + color = __color, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.SimpleMessage] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.SimpleMessage( - i = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Int]) - .getOrElse(0), - j = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(2).get) - .map(_.as[_root_.scala.Int]) - .getOrElse(0), - k = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(3).get) - .map(_.as[_root_.com.google.protobuf.ByteString]) - .getOrElse(_root_.com.google.protobuf.ByteString.EMPTY), - color = scalapb.perf.protos.Color.fromValue( - __fieldsMap - .get(scalaDescriptor.findFieldByNumber(4).get) - .map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]) - .getOrElse(scalapb.perf.protos.Color.UNKNOWN.scalaValueDescriptor) - .number - ) - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(0) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(0) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = { - (__fieldNumber: @ _root_.scala.unchecked) match { + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.SimpleMessage] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.SimpleMessage( + i = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0), + j = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Int]).getOrElse(0), + k = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY), + color = scalapb.perf.protos.Color.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(scalapb.perf.protos.Color.UNKNOWN.scalaValueDescriptor).number) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = { + (__fieldNumber: @_root_.scala.unchecked) match { case 4 => scalapb.perf.protos.Color } } @@ -222,27 +186,21 @@ object SimpleMessage extends scalapb.GeneratedMessageCompanion[scalapb.perf.prot k = _root_.com.google.protobuf.ByteString.EMPTY, color = scalapb.perf.protos.Color.UNKNOWN ) - implicit class SimpleMessageLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.SimpleMessage] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.SimpleMessage](_l) { - def i: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = - field(_.i)((c_, f_) => c_.copy(i = f_)) - def j: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = - field(_.j)((c_, f_) => c_.copy(j = f_)) - def k: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = - field(_.k)((c_, f_) => c_.copy(k = f_)) - def color: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Color] = - field(_.color)((c_, f_) => c_.copy(color = f_)) + implicit class SimpleMessageLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.SimpleMessage]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.SimpleMessage](_l) { + def i: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.i)((c_, f_) => c_.copy(i = f_)) + def j: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.j)((c_, f_) => c_.copy(j = f_)) + def k: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.k)((c_, f_) => c_.copy(k = f_)) + def color: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.Color] = field(_.color)((c_, f_) => c_.copy(color = f_)) } - final val I_FIELD_NUMBER = 1 - final val J_FIELD_NUMBER = 2 - final val K_FIELD_NUMBER = 3 + final val I_FIELD_NUMBER = 1 + final val J_FIELD_NUMBER = 2 + final val K_FIELD_NUMBER = 3 final val COLOR_FIELD_NUMBER = 4 def of( - i: _root_.scala.Int, - j: _root_.scala.Int, - k: _root_.com.google.protobuf.ByteString, - color: scalapb.perf.protos.Color + i: _root_.scala.Int, + j: _root_.scala.Int, + k: _root_.com.google.protobuf.ByteString, + color: scalapb.perf.protos.Color ): _root_.scalapb.perf.protos.SimpleMessage = _root_.scalapb.perf.protos.SimpleMessage( i, j, diff --git a/docs/src/main/scala/generated/scalapb/perf/protos/StringMessage.scala b/docs/src/main/scala/generated/scalapb/perf/protos/StringMessage.scala index cde53ecf9..1c88e2633 100644 --- a/docs/src/main/scala/generated/scalapb/perf/protos/StringMessage.scala +++ b/docs/src/main/scala/generated/scalapb/perf/protos/StringMessage.scala @@ -10,94 +10,87 @@ final case class StringMessage( str1: _root_.scala.Predef.String = "", str2: _root_.scala.Predef.String = "", unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty -) extends scalapb.GeneratedMessage - with scalapb.lenses.Updatable[StringMessage] { - @transient - private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 - private[this] def __computeSerializedSize(): _root_.scala.Int = { - var __size = 0 - - { - val __value = str1 - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) - } - }; - - { - val __value = str2 - if (!__value.isEmpty) { - __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) - } - }; - __size += unknownFields.serializedSize - __size - } - override def serializedSize: _root_.scala.Int = { - var __size = __serializedSizeMemoized - if (__size == 0) { - __size = __computeSerializedSize() + 1 - __serializedSizeMemoized = __size + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[StringMessage] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = str1 + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = str2 + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size } - __size - 1 - - } - def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { - { - val __v = str1 - if (!__v.isEmpty) { - _output__.writeString(1, __v) + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size } - }; - { - val __v = str2 - if (!__v.isEmpty) { - _output__.writeString(2, __v) - } - }; - unknownFields.writeTo(_output__) - } - def withStr1(__v: _root_.scala.Predef.String): StringMessage = copy(str1 = __v) - def withStr2(__v: _root_.scala.Predef.String): StringMessage = copy(str2 = __v) - def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) - def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) - def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { - (__fieldNumber: @ _root_.scala.unchecked) match { - case 1 => { - val __t = str1 - if (__t != "") __t else null - } - case 2 => { - val __t = str2 - if (__t != "") __t else null + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = str1 + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = str2 + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withStr1(__v: _root_.scala.Predef.String): StringMessage = copy(str1 = __v) + def withStr2(__v: _root_.scala.Predef.String): StringMessage = copy(str2 = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = str1 + if (__t != "") __t else null + } + case 2 => { + val __t = str2 + if (__t != "") __t else null + } } } - } - def getField( - __field: _root_.scalapb.descriptors.FieldDescriptor - ): _root_.scalapb.descriptors.PValue = { - _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) - (__field.number: @ _root_.scala.unchecked) match { - case 1 => _root_.scalapb.descriptors.PString(str1) - case 2 => _root_.scalapb.descriptors.PString(str2) + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(str1) + case 2 => _root_.scalapb.descriptors.PString(str2) + } } - } - def toProtoString: _root_.scala.Predef.String = - _root_.scalapb.TextFormat.printToUnicodeString(this) - def companion: scalapb.perf.protos.StringMessage.type = scalapb.perf.protos.StringMessage - // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.StringMessage]) + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: scalapb.perf.protos.StringMessage.type = scalapb.perf.protos.StringMessage + // @@protoc_insertion_point(GeneratedMessage[scalapb.perf.StringMessage]) } object StringMessage extends scalapb.GeneratedMessageCompanion[scalapb.perf.protos.StringMessage] { - implicit def messageCompanion - : scalapb.GeneratedMessageCompanion[scalapb.perf.protos.StringMessage] = this - def parseFrom( - `_input__`: _root_.com.google.protobuf.CodedInputStream - ): scalapb.perf.protos.StringMessage = { - var __str1: _root_.scala.Predef.String = "" - var __str2: _root_.scala.Predef.String = "" - var `_unknownFields__` : _root_.scalapb.UnknownFieldSet.Builder = null - var _done__ = false + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[scalapb.perf.protos.StringMessage] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): scalapb.perf.protos.StringMessage = { + var __str1: _root_.scala.Predef.String = "" + var __str2: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false while (!_done__) { val _tag__ = _input__.readTag() _tag__ match { @@ -114,62 +107,38 @@ object StringMessage extends scalapb.GeneratedMessageCompanion[scalapb.perf.prot } } scalapb.perf.protos.StringMessage( - str1 = __str1, - str2 = __str2, - unknownFields = - if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty - else _unknownFields__.result() + str1 = __str1, + str2 = __str2, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } - implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.StringMessage] = - _root_.scalapb.descriptors.Reads { - case _root_.scalapb.descriptors.PMessage(__fieldsMap) => - _root_.scala.Predef.require( - __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), - "FieldDescriptor does not match message type." - ) - scalapb.perf.protos.StringMessage( - str1 = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(1).get) - .map(_.as[_root_.scala.Predef.String]) - .getOrElse(""), - str2 = __fieldsMap - .get(scalaDescriptor.findFieldByNumber(2).get) - .map(_.as[_root_.scala.Predef.String]) - .getOrElse("") - ) - case _ => throw new RuntimeException("Expected PMessage") - } - def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = - ProtosProto.javaDescriptor.getMessageTypes().get(5) - def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = - ProtosProto.scalaDescriptor.messages(5) - def messageCompanionForFieldNumber( - __number: _root_.scala.Int - ): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) - lazy val nestedMessagesCompanions - : Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = - Seq.empty - def enumCompanionForFieldNumber( - __fieldNumber: _root_.scala.Int - ): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + implicit def messageReads: _root_.scalapb.descriptors.Reads[scalapb.perf.protos.StringMessage] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + scalapb.perf.protos.StringMessage( + str1 = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + str2 = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ProtosProto.javaDescriptor.getMessageTypes().get(5) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ProtosProto.scalaDescriptor.messages(5) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) lazy val defaultInstance = scalapb.perf.protos.StringMessage( str1 = "", str2 = "" ) - implicit class StringMessageLens[UpperPB]( - _l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.StringMessage] - ) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.StringMessage](_l) { - def str1: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = - field(_.str1)((c_, f_) => c_.copy(str1 = f_)) - def str2: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = - field(_.str2)((c_, f_) => c_.copy(str2 = f_)) + implicit class StringMessageLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.perf.protos.StringMessage]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.perf.protos.StringMessage](_l) { + def str1: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.str1)((c_, f_) => c_.copy(str1 = f_)) + def str2: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.str2)((c_, f_) => c_.copy(str2 = f_)) } final val STR1_FIELD_NUMBER = 1 final val STR2_FIELD_NUMBER = 2 def of( - str1: _root_.scala.Predef.String, - str2: _root_.scala.Predef.String + str1: _root_.scala.Predef.String, + str2: _root_.scala.Predef.String ): _root_.scalapb.perf.protos.StringMessage = _root_.scalapb.perf.protos.StringMessage( str1, str2 diff --git a/make_plugin_proto.sh b/make_plugin_proto.sh index 4f69804ae..0bd58b8a6 100755 --- a/make_plugin_proto.sh +++ b/make_plugin_proto.sh @@ -8,13 +8,16 @@ GOOGLE_PROTOS=$(find third_party/google/protobuf/ -name '*.proto' -print) sbt "scalapbcJVM2_12/run --scala_out=java_conversions:scalapb-runtime/src/main/scalajvm \ --proto_path=./third_party \ - $GOOGLE_PROTOS" \ - "scalapbcJVM2_12/run --scala_out=scalapb-runtime/src/main/js-native \ + $GOOGLE_PROTOS" + +sbt "scalapbcJVM2_12/run --scala_out=scalapb-runtime/src/main/js-native \ --proto_path=./third_party \ - $GOOGLE_PROTOS" \ - "scalapbcJVM2_12/run --scala_out=scalapb-runtime/src/main/scala \ - --proto_path=./protobuf:./third_party ./protobuf/scalapb/scalapb.proto" \ - "scalapbcJVM2_12/run --scala_out=docs/src/main/scala/generated \ + $GOOGLE_PROTOS" + +sbt "scalapbcJVM2_12/run --scala_out=scalapb-runtime/src/main/scala \ + --proto_path=./protobuf:./third_party ./protobuf/scalapb/scalapb.proto" + +sbt "scalapbcJVM2_12/run --scala_out=docs/src/main/scala/generated \ --proto_path=./protobuf:./third_party:./docs/src/main/protobuf:./benchmarks/src/main/protobuf \ ./docs/src/main/protobuf/duration.proto \ ./docs/src/main/protobuf/json.proto \ diff --git a/scalapb-runtime/src/main/scala/scalapb/options/MessageOptions.scala b/scalapb-runtime/src/main/scala/scalapb/options/MessageOptions.scala index aac50e489..49df80113 100644 --- a/scalapb-runtime/src/main/scala/scalapb/options/MessageOptions.scala +++ b/scalapb-runtime/src/main/scala/scalapb/options/MessageOptions.scala @@ -27,6 +27,8 @@ package scalapb.options * If true, no default values will be generated in message constructors. * If set (to true or false), the message-level setting overrides the * file-level value, and can be overridden by the field-level setting. + * @param sealedOneofCompanionExtends + * Additional classes and traits to mix in to generated sealed oneof base trait's companion object. */ @SerialVersionUID(0L) final case class MessageOptions( @@ -39,6 +41,7 @@ final case class MessageOptions( noBox: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None, unknownFieldsAnnotations: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, noDefaultValuesInConstructor: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None, + sealedOneofCompanionExtends: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MessageOptions] with _root_.scalapb.ExtendableMessage[MessageOptions] { @transient @@ -81,6 +84,10 @@ final case class MessageOptions( val __value = noDefaultValuesInConstructor.get __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(9, __value) }; + sealedOneofCompanionExtends.foreach { __item => + val __value = __item + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(10, __value) + } __size += unknownFields.serializedSize __size } @@ -130,6 +137,10 @@ final case class MessageOptions( val __m = __v _output__.writeBool(9, __m) }; + sealedOneofCompanionExtends.foreach { __v => + val __m = __v + _output__.writeString(10, __m) + }; unknownFields.writeTo(_output__) } def clearExtends = copy(`extends` = _root_.scala.Seq.empty) @@ -165,6 +176,10 @@ final case class MessageOptions( def getNoDefaultValuesInConstructor: _root_.scala.Boolean = noDefaultValuesInConstructor.getOrElse(false) def clearNoDefaultValuesInConstructor: MessageOptions = copy(noDefaultValuesInConstructor = _root_.scala.None) def withNoDefaultValuesInConstructor(__v: _root_.scala.Boolean): MessageOptions = copy(noDefaultValuesInConstructor = Option(__v)) + def clearSealedOneofCompanionExtends = copy(sealedOneofCompanionExtends = _root_.scala.Seq.empty) + def addSealedOneofCompanionExtends(__vs: _root_.scala.Predef.String *): MessageOptions = addAllSealedOneofCompanionExtends(__vs) + def addAllSealedOneofCompanionExtends(__vs: Iterable[_root_.scala.Predef.String]): MessageOptions = copy(sealedOneofCompanionExtends = sealedOneofCompanionExtends ++ __vs) + def withSealedOneofCompanionExtends(__v: _root_.scala.Seq[_root_.scala.Predef.String]): MessageOptions = copy(sealedOneofCompanionExtends = __v) def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { @@ -178,6 +193,7 @@ final case class MessageOptions( case 7 => noBox.orNull case 8 => unknownFieldsAnnotations case 9 => noDefaultValuesInConstructor.orNull + case 10 => sealedOneofCompanionExtends } } def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { @@ -192,6 +208,7 @@ final case class MessageOptions( case 7 => noBox.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty) case 8 => _root_.scalapb.descriptors.PRepeated(unknownFieldsAnnotations.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) case 9 => noDefaultValuesInConstructor.map(_root_.scalapb.descriptors.PBoolean(_)).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 10 => _root_.scalapb.descriptors.PRepeated(sealedOneofCompanionExtends.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) } } def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) @@ -211,6 +228,7 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. var __noBox: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None val __unknownFieldsAnnotations: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] var __noDefaultValuesInConstructor: _root_.scala.Option[_root_.scala.Boolean] = _root_.scala.None + val __sealedOneofCompanionExtends: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null var _done__ = false while (!_done__) { @@ -235,6 +253,8 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. __unknownFieldsAnnotations += _input__.readStringRequireUtf8() case 72 => __noDefaultValuesInConstructor = Option(_input__.readBool()) + case 82 => + __sealedOneofCompanionExtends += _input__.readStringRequireUtf8() case tag => if (_unknownFields__ == null) { _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() @@ -252,6 +272,7 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. noBox = __noBox, unknownFieldsAnnotations = __unknownFieldsAnnotations.result(), noDefaultValuesInConstructor = __noDefaultValuesInConstructor, + sealedOneofCompanionExtends = __sealedOneofCompanionExtends.result(), unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() ) } @@ -267,7 +288,8 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. sealedOneofExtends = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), noBox = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]), unknownFieldsAnnotations = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), - noDefaultValuesInConstructor = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]) + noDefaultValuesInConstructor = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Boolean]]), + sealedOneofCompanionExtends = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty) ) case _ => throw new RuntimeException("Expected PMessage") } @@ -285,7 +307,8 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. sealedOneofExtends = _root_.scala.Seq.empty, noBox = _root_.scala.None, unknownFieldsAnnotations = _root_.scala.Seq.empty, - noDefaultValuesInConstructor = _root_.scala.None + noDefaultValuesInConstructor = _root_.scala.None, + sealedOneofCompanionExtends = _root_.scala.Seq.empty ) implicit class MessageOptionsLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, scalapb.options.MessageOptions]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, scalapb.options.MessageOptions](_l) { def `extends`: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.`extends`)((c_, f_) => c_.copy(`extends` = f_)) @@ -300,6 +323,7 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. def unknownFieldsAnnotations: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.unknownFieldsAnnotations)((c_, f_) => c_.copy(unknownFieldsAnnotations = f_)) def noDefaultValuesInConstructor: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.getNoDefaultValuesInConstructor)((c_, f_) => c_.copy(noDefaultValuesInConstructor = Option(f_))) def optionalNoDefaultValuesInConstructor: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[_root_.scala.Boolean]] = field(_.noDefaultValuesInConstructor)((c_, f_) => c_.copy(noDefaultValuesInConstructor = f_)) + def sealedOneofCompanionExtends: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.sealedOneofCompanionExtends)((c_, f_) => c_.copy(sealedOneofCompanionExtends = f_)) } final val EXTENDS_FIELD_NUMBER = 1 final val COMPANION_EXTENDS_FIELD_NUMBER = 2 @@ -310,6 +334,7 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. final val NO_BOX_FIELD_NUMBER = 7 final val UNKNOWN_FIELDS_ANNOTATIONS_FIELD_NUMBER = 8 final val NO_DEFAULT_VALUES_IN_CONSTRUCTOR_FIELD_NUMBER = 9 + final val SEALED_ONEOF_COMPANION_EXTENDS_FIELD_NUMBER = 10 def of( `extends`: _root_.scala.Seq[_root_.scala.Predef.String], companionExtends: _root_.scala.Seq[_root_.scala.Predef.String], @@ -319,7 +344,8 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. sealedOneofExtends: _root_.scala.Seq[_root_.scala.Predef.String], noBox: _root_.scala.Option[_root_.scala.Boolean], unknownFieldsAnnotations: _root_.scala.Seq[_root_.scala.Predef.String], - noDefaultValuesInConstructor: _root_.scala.Option[_root_.scala.Boolean] + noDefaultValuesInConstructor: _root_.scala.Option[_root_.scala.Boolean], + sealedOneofCompanionExtends: _root_.scala.Seq[_root_.scala.Predef.String] ): _root_.scalapb.options.MessageOptions = _root_.scalapb.options.MessageOptions( `extends`, companionExtends, @@ -329,7 +355,8 @@ object MessageOptions extends scalapb.GeneratedMessageCompanion[scalapb.options. sealedOneofExtends, noBox, unknownFieldsAnnotations, - noDefaultValuesInConstructor + noDefaultValuesInConstructor, + sealedOneofCompanionExtends ) // @@protoc_insertion_point(GeneratedMessageCompanion[scalapb.MessageOptions]) } diff --git a/scalapb-runtime/src/main/scala/scalapb/options/ScalapbProto.scala b/scalapb-runtime/src/main/scala/scalapb/options/ScalapbProto.scala index bfb73b5ef..fb4a9ddda 100644 --- a/scalapb-runtime/src/main/scala/scalapb/options/ScalapbProto.scala +++ b/scalapb-runtime/src/main/scala/scalapb/options/ScalapbProto.scala @@ -60,7 +60,7 @@ object ScalapbProto extends _root_.scalapb.GeneratedFileObject { woGdGFyZ2V0GAEgASgJQgviPwgSBnRhcmdldFIGdGFyZ2V0EkEKB29wdGlvbnMYAiABKAsyGS5zY2FsYXBiLkVudW1WYWx1ZU9wd GlvbnNCDOI/CRIHb3B0aW9uc1IHb3B0aW9ucyI+CgxPcHRpb25zU2NvcGUSEwoERklMRRAAGgniPwYSBEZJTEUSGQoHUEFDS0FHR RABGgziPwkSB1BBQ0tBR0UiVQoPRW51bVZhbHVlTmFtaW5nEiEKC0FTX0lOX1BST1RPEAAaEOI/DRILQVNfSU5fUFJPVE8SHwoKQ - 0FNRUxfQ0FTRRABGg/iPwwSCkNBTUVMX0NBU0UqCQjoBxCAgICAAiLgBAoOTWVzc2FnZU9wdGlvbnMSJgoHZXh0ZW5kcxgBIAMoC + 0FNRUxfQ0FTRRABGg/iPwwSCkNBTUVMX0NBU0UqCQjoBxCAgICAAiLHBQoOTWVzc2FnZU9wdGlvbnMSJgoHZXh0ZW5kcxgBIAMoC UIM4j8JEgdleHRlbmRzUgdleHRlbmRzEkIKEWNvbXBhbmlvbl9leHRlbmRzGAIgAygJQhXiPxISEGNvbXBhbmlvbkV4dGVuZHNSE GNvbXBhbmlvbkV4dGVuZHMSMgoLYW5ub3RhdGlvbnMYAyADKAlCEOI/DRILYW5ub3RhdGlvbnNSC2Fubm90YXRpb25zEh0KBHR5c GUYBCABKAlCCeI/BhIEdHlwZVIEdHlwZRJOChVjb21wYW5pb25fYW5ub3RhdGlvbnMYBSADKAlCGeI/FhIUY29tcGFuaW9uQW5ub @@ -68,41 +68,43 @@ object ScalapbProto extends _root_.scalapb.GeneratedFileObject { W9mRXh0ZW5kc1ISc2VhbGVkT25lb2ZFeHRlbmRzEiEKBm5vX2JveBgHIAEoCEIK4j8HEgVub0JveFIFbm9Cb3gSWwoadW5rbm93b l9maWVsZHNfYW5ub3RhdGlvbnMYCCADKAlCHeI/GhIYdW5rbm93bkZpZWxkc0Fubm90YXRpb25zUhh1bmtub3duRmllbGRzQW5ub 3RhdGlvbnMSaQogbm9fZGVmYXVsdF92YWx1ZXNfaW5fY29uc3RydWN0b3IYCSABKAhCIeI/HhIcbm9EZWZhdWx0VmFsdWVzSW5Db - 25zdHJ1Y3RvclIcbm9EZWZhdWx0VmFsdWVzSW5Db25zdHJ1Y3RvcioJCOgHEICAgIACIn8KCkNvbGxlY3Rpb24SHQoEdHlwZRgBI - AEoCUIJ4j8GEgR0eXBlUgR0eXBlEioKCW5vbl9lbXB0eRgCIAEoCEIN4j8KEghub25FbXB0eVIIbm9uRW1wdHkSJgoHYWRhcHRlc - hgDIAEoCUIM4j8JEgdhZGFwdGVyUgdhZGFwdGVyItYECgxGaWVsZE9wdGlvbnMSHQoEdHlwZRgBIAEoCUIJ4j8GEgR0eXBlUgR0e - XBlEi0KCnNjYWxhX25hbWUYAiABKAlCDuI/CxIJc2NhbGFOYW1lUglzY2FsYU5hbWUSPAoPY29sbGVjdGlvbl90eXBlGAMgASgJQ - hPiPxASDmNvbGxlY3Rpb25UeXBlUg5jb2xsZWN0aW9uVHlwZRJECgpjb2xsZWN0aW9uGAggASgLMhMuc2NhbGFwYi5Db2xsZWN0a - W9uQg/iPwwSCmNvbGxlY3Rpb25SCmNvbGxlY3Rpb24SJwoIa2V5X3R5cGUYBCABKAlCDOI/CRIHa2V5VHlwZVIHa2V5VHlwZRItC - gp2YWx1ZV90eXBlGAUgASgJQg7iPwsSCXZhbHVlVHlwZVIJdmFsdWVUeXBlEjIKC2Fubm90YXRpb25zGAYgAygJQhDiPw0SC2Fub - m90YXRpb25zUgthbm5vdGF0aW9ucxInCghtYXBfdHlwZRgHIAEoCUIM4j8JEgdtYXBUeXBlUgdtYXBUeXBlEmYKH25vX2RlZmF1b - HRfdmFsdWVfaW5fY29uc3RydWN0b3IYCSABKAhCIOI/HRIbbm9EZWZhdWx0VmFsdWVJbkNvbnN0cnVjdG9yUhtub0RlZmF1bHRWY - Wx1ZUluQ29uc3RydWN0b3ISIQoGbm9fYm94GB4gASgIQgriPwcSBW5vQm94UgVub0JveBIpCghyZXF1aXJlZBgfIAEoCEIN4j8KE - ghyZXF1aXJlZFIIcmVxdWlyZWQqCQjoBxCAgICAAiKQAwoLRW51bU9wdGlvbnMSJgoHZXh0ZW5kcxgBIAMoCUIM4j8JEgdleHRlb - mRzUgdleHRlbmRzEkIKEWNvbXBhbmlvbl9leHRlbmRzGAIgAygJQhXiPxISEGNvbXBhbmlvbkV4dGVuZHNSEGNvbXBhbmlvbkV4d - GVuZHMSHQoEdHlwZRgDIAEoCUIJ4j8GEgR0eXBlUgR0eXBlEj8KEGJhc2VfYW5ub3RhdGlvbnMYBCADKAlCFOI/ERIPYmFzZUFub - m90YXRpb25zUg9iYXNlQW5ub3RhdGlvbnMSUQoWcmVjb2duaXplZF9hbm5vdGF0aW9ucxgFIAMoCUIa4j8XEhVyZWNvZ25pemVkQ - W5ub3RhdGlvbnNSFXJlY29nbml6ZWRBbm5vdGF0aW9ucxJXChh1bnJlY29nbml6ZWRfYW5ub3RhdGlvbnMYBiADKAlCHOI/GRIXd - W5yZWNvZ25pemVkQW5ub3RhdGlvbnNSF3VucmVjb2duaXplZEFubm90YXRpb25zKgkI6AcQgICAgAIiqAEKEEVudW1WYWx1ZU9wd - GlvbnMSJgoHZXh0ZW5kcxgBIAMoCUIM4j8JEgdleHRlbmRzUgdleHRlbmRzEi0KCnNjYWxhX25hbWUYAiABKAlCDuI/CxIJc2Nhb - GFOYW1lUglzY2FsYU5hbWUSMgoLYW5ub3RhdGlvbnMYAyADKAlCEOI/DRILYW5ub3RhdGlvbnNSC2Fubm90YXRpb25zKgkI6AcQg - ICAgAIicAoMT25lb2ZPcHRpb25zEiYKB2V4dGVuZHMYASADKAlCDOI/CRIHZXh0ZW5kc1IHZXh0ZW5kcxItCgpzY2FsYV9uYW1lG - AIgASgJQg7iPwsSCXNjYWxhTmFtZVIJc2NhbGFOYW1lKgkI6AcQgICAgAIi4wEKE0ZpZWxkVHJhbnNmb3JtYXRpb24SRAoEd2hlb - hgBIAEoCzIlLmdvb2dsZS5wcm90b2J1Zi5GaWVsZERlc2NyaXB0b3JQcm90b0IJ4j8GEgR3aGVuUgR3aGVuEksKCm1hdGNoX3R5c - GUYAiABKA4yEi5zY2FsYXBiLk1hdGNoVHlwZToIQ09OVEFJTlNCDuI/CxIJbWF0Y2hUeXBlUgltYXRjaFR5cGUSOQoDc2V0GAMgA - SgLMh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9uc0II4j8FEgNzZXRSA3NldCLxAQoSUHJlcHJvY2Vzc29yT3V0cHV0EmoKD - 29wdGlvbnNfYnlfZmlsZRgBIAMoCzIuLnNjYWxhcGIuUHJlcHJvY2Vzc29yT3V0cHV0Lk9wdGlvbnNCeUZpbGVFbnRyeUIS4j8PE - g1vcHRpb25zQnlGaWxlUg1vcHRpb25zQnlGaWxlGm8KEk9wdGlvbnNCeUZpbGVFbnRyeRIaCgNrZXkYASABKAlCCOI/BRIDa2V5U - gNrZXkSOQoFdmFsdWUYAiABKAsyFy5zY2FsYXBiLlNjYWxhUGJPcHRpb25zQgriPwcSBXZhbHVlUgV2YWx1ZToCOAEqXAoJTWF0Y - 2hUeXBlEhsKCENPTlRBSU5TEAAaDeI/ChIIQ09OVEFJTlMSFQoFRVhBQ1QQARoK4j8HEgVFWEFDVBIbCghQUkVTRU5DRRACGg3iP - woSCFBSRVNFTkNFOlAKB29wdGlvbnMSHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMY/AcgASgLMhcuc2NhbGFwYi5TY2FsY - VBiT3B0aW9uc1IHb3B0aW9uczpTCgdtZXNzYWdlEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGPwHIAEoCzIXLnNjY - WxhcGIuTWVzc2FnZU9wdGlvbnNSB21lc3NhZ2U6SwoFZmllbGQSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGPwHIAEoC - zIVLnNjYWxhcGIuRmllbGRPcHRpb25zUgVmaWVsZDpWCgxlbnVtX29wdGlvbnMSHC5nb29nbGUucHJvdG9idWYuRW51bU9wdGlvb - nMY/AcgASgLMhQuc2NhbGFwYi5FbnVtT3B0aW9uc1ILZW51bU9wdGlvbnM6XAoKZW51bV92YWx1ZRIhLmdvb2dsZS5wcm90b2J1Z - i5FbnVtVmFsdWVPcHRpb25zGPwHIAEoCzIZLnNjYWxhcGIuRW51bVZhbHVlT3B0aW9uc1IJZW51bVZhbHVlOksKBW9uZW9mEh0uZ - 29vZ2xlLnByb3RvYnVmLk9uZW9mT3B0aW9ucxj8ByABKAsyFS5zY2FsYXBiLk9uZW9mT3B0aW9uc1IFb25lb2ZCJwoPc2NhbGFwY - i5vcHRpb25z4j8TCg9zY2FsYXBiLm9wdGlvbnMQAQ==""" + 25zdHJ1Y3RvclIcbm9EZWZhdWx0VmFsdWVzSW5Db25zdHJ1Y3RvchJlCh5zZWFsZWRfb25lb2ZfY29tcGFuaW9uX2V4dGVuZHMYC + iADKAlCIOI/HRIbc2VhbGVkT25lb2ZDb21wYW5pb25FeHRlbmRzUhtzZWFsZWRPbmVvZkNvbXBhbmlvbkV4dGVuZHMqCQjoBxCAg + ICAAiJ/CgpDb2xsZWN0aW9uEh0KBHR5cGUYASABKAlCCeI/BhIEdHlwZVIEdHlwZRIqCglub25fZW1wdHkYAiABKAhCDeI/ChIIb + m9uRW1wdHlSCG5vbkVtcHR5EiYKB2FkYXB0ZXIYAyABKAlCDOI/CRIHYWRhcHRlclIHYWRhcHRlciLWBAoMRmllbGRPcHRpb25zE + h0KBHR5cGUYASABKAlCCeI/BhIEdHlwZVIEdHlwZRItCgpzY2FsYV9uYW1lGAIgASgJQg7iPwsSCXNjYWxhTmFtZVIJc2NhbGFOY + W1lEjwKD2NvbGxlY3Rpb25fdHlwZRgDIAEoCUIT4j8QEg5jb2xsZWN0aW9uVHlwZVIOY29sbGVjdGlvblR5cGUSRAoKY29sbGVjd + GlvbhgIIAEoCzITLnNjYWxhcGIuQ29sbGVjdGlvbkIP4j8MEgpjb2xsZWN0aW9uUgpjb2xsZWN0aW9uEicKCGtleV90eXBlGAQgA + SgJQgziPwkSB2tleVR5cGVSB2tleVR5cGUSLQoKdmFsdWVfdHlwZRgFIAEoCUIO4j8LEgl2YWx1ZVR5cGVSCXZhbHVlVHlwZRIyC + gthbm5vdGF0aW9ucxgGIAMoCUIQ4j8NEgthbm5vdGF0aW9uc1ILYW5ub3RhdGlvbnMSJwoIbWFwX3R5cGUYByABKAlCDOI/CRIHb + WFwVHlwZVIHbWFwVHlwZRJmCh9ub19kZWZhdWx0X3ZhbHVlX2luX2NvbnN0cnVjdG9yGAkgASgIQiDiPx0SG25vRGVmYXVsdFZhb + HVlSW5Db25zdHJ1Y3RvclIbbm9EZWZhdWx0VmFsdWVJbkNvbnN0cnVjdG9yEiEKBm5vX2JveBgeIAEoCEIK4j8HEgVub0JveFIFb + m9Cb3gSKQoIcmVxdWlyZWQYHyABKAhCDeI/ChIIcmVxdWlyZWRSCHJlcXVpcmVkKgkI6AcQgICAgAIikAMKC0VudW1PcHRpb25zE + iYKB2V4dGVuZHMYASADKAlCDOI/CRIHZXh0ZW5kc1IHZXh0ZW5kcxJCChFjb21wYW5pb25fZXh0ZW5kcxgCIAMoCUIV4j8SEhBjb + 21wYW5pb25FeHRlbmRzUhBjb21wYW5pb25FeHRlbmRzEh0KBHR5cGUYAyABKAlCCeI/BhIEdHlwZVIEdHlwZRI/ChBiYXNlX2Fub + m90YXRpb25zGAQgAygJQhTiPxESD2Jhc2VBbm5vdGF0aW9uc1IPYmFzZUFubm90YXRpb25zElEKFnJlY29nbml6ZWRfYW5ub3Rhd + GlvbnMYBSADKAlCGuI/FxIVcmVjb2duaXplZEFubm90YXRpb25zUhVyZWNvZ25pemVkQW5ub3RhdGlvbnMSVwoYdW5yZWNvZ25pe + mVkX2Fubm90YXRpb25zGAYgAygJQhziPxkSF3VucmVjb2duaXplZEFubm90YXRpb25zUhd1bnJlY29nbml6ZWRBbm5vdGF0aW9uc + yoJCOgHEICAgIACIqgBChBFbnVtVmFsdWVPcHRpb25zEiYKB2V4dGVuZHMYASADKAlCDOI/CRIHZXh0ZW5kc1IHZXh0ZW5kcxItC + gpzY2FsYV9uYW1lGAIgASgJQg7iPwsSCXNjYWxhTmFtZVIJc2NhbGFOYW1lEjIKC2Fubm90YXRpb25zGAMgAygJQhDiPw0SC2Fub + m90YXRpb25zUgthbm5vdGF0aW9ucyoJCOgHEICAgIACInAKDE9uZW9mT3B0aW9ucxImCgdleHRlbmRzGAEgAygJQgziPwkSB2V4d + GVuZHNSB2V4dGVuZHMSLQoKc2NhbGFfbmFtZRgCIAEoCUIO4j8LEglzY2FsYU5hbWVSCXNjYWxhTmFtZSoJCOgHEICAgIACIuMBC + hNGaWVsZFRyYW5zZm9ybWF0aW9uEkQKBHdoZW4YASABKAsyJS5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9yUHJvdG9CC + eI/BhIEd2hlblIEd2hlbhJLCgptYXRjaF90eXBlGAIgASgOMhIuc2NhbGFwYi5NYXRjaFR5cGU6CENPTlRBSU5TQg7iPwsSCW1hd + GNoVHlwZVIJbWF0Y2hUeXBlEjkKA3NldBgDIAEoCzIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnNCCOI/BRIDc2V0UgNzZ + XQi8QEKElByZXByb2Nlc3Nvck91dHB1dBJqCg9vcHRpb25zX2J5X2ZpbGUYASADKAsyLi5zY2FsYXBiLlByZXByb2Nlc3Nvck91d + HB1dC5PcHRpb25zQnlGaWxlRW50cnlCEuI/DxINb3B0aW9uc0J5RmlsZVINb3B0aW9uc0J5RmlsZRpvChJPcHRpb25zQnlGaWxlR + W50cnkSGgoDa2V5GAEgASgJQgjiPwUSA2tleVIDa2V5EjkKBXZhbHVlGAIgASgLMhcuc2NhbGFwYi5TY2FsYVBiT3B0aW9uc0IK4 + j8HEgV2YWx1ZVIFdmFsdWU6AjgBKlwKCU1hdGNoVHlwZRIbCghDT05UQUlOUxAAGg3iPwoSCENPTlRBSU5TEhUKBUVYQUNUEAEaC + uI/BxIFRVhBQ1QSGwoIUFJFU0VOQ0UQAhoN4j8KEghQUkVTRU5DRTpQCgdvcHRpb25zEhwuZ29vZ2xlLnByb3RvYnVmLkZpbGVPc + HRpb25zGPwHIAEoCzIXLnNjYWxhcGIuU2NhbGFQYk9wdGlvbnNSB29wdGlvbnM6UwoHbWVzc2FnZRIfLmdvb2dsZS5wcm90b2J1Z + i5NZXNzYWdlT3B0aW9ucxj8ByABKAsyFy5zY2FsYXBiLk1lc3NhZ2VPcHRpb25zUgdtZXNzYWdlOksKBWZpZWxkEh0uZ29vZ2xlL + nByb3RvYnVmLkZpZWxkT3B0aW9ucxj8ByABKAsyFS5zY2FsYXBiLkZpZWxkT3B0aW9uc1IFZmllbGQ6VgoMZW51bV9vcHRpb25zE + hwuZ29vZ2xlLnByb3RvYnVmLkVudW1PcHRpb25zGPwHIAEoCzIULnNjYWxhcGIuRW51bU9wdGlvbnNSC2VudW1PcHRpb25zOlwKC + mVudW1fdmFsdWUSIS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlT3B0aW9ucxj8ByABKAsyGS5zY2FsYXBiLkVudW1WYWx1ZU9wd + GlvbnNSCWVudW1WYWx1ZTpLCgVvbmVvZhIdLmdvb2dsZS5wcm90b2J1Zi5PbmVvZk9wdGlvbnMY/AcgASgLMhUuc2NhbGFwYi5Pb + mVvZk9wdGlvbnNSBW9uZW9mQksKD3NjYWxhcGIub3B0aW9uc1oic2NhbGFwYi5naXRodWIuaW8vcHJvdG9idWYvc2NhbGFwYuI/E + woPc2NhbGFwYi5vcHRpb25zEAE=""" ).mkString) lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes)