@@ -7,69 +7,83 @@ package com.thesamet.docs.json
77final case class MyContainer (
88 myAny : _root_.scala.Option [com.google.protobuf.any.Any ] = _root_.scala.None ,
99 unknownFields : _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet .empty
10- ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable [MyContainer ] {
11- @ transient
12- private [this ] var __serializedSizeMemoized : _root_.scala.Int = 0
13- private [this ] def __computeSerializedSize (): _root_.scala.Int = {
14- var __size = 0
15- if (myAny.isDefined) {
16- val __value = myAny.get
17- __size += 1 + _root_.com.google.protobuf.CodedOutputStream .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
18- };
19- __size += unknownFields.serializedSize
20- __size
21- }
22- override def serializedSize : _root_.scala.Int = {
23- var __size = __serializedSizeMemoized
24- if (__size == 0 ) {
25- __size = __computeSerializedSize() + 1
26- __serializedSizeMemoized = __size
27- }
28- __size - 1
29-
30- }
31- def writeTo (`_output__` : _root_.com.google.protobuf.CodedOutputStream ): _root_.scala.Unit = {
32- myAny.foreach { __v =>
33- val __m = __v
34- _output__.writeTag(1 , 2 )
35- _output__.writeUInt32NoTag(__m.serializedSize)
36- __m.writeTo(_output__)
37- };
38- unknownFields.writeTo(_output__)
10+ ) extends scalapb.GeneratedMessage
11+ with scalapb.lenses.Updatable [MyContainer ] {
12+ @ transient
13+ private [this ] var __serializedSizeMemoized : _root_.scala.Int = 0
14+ private [this ] def __computeSerializedSize (): _root_.scala.Int = {
15+ var __size = 0
16+ if (myAny.isDefined) {
17+ val __value = myAny.get
18+ __size += 1 + _root_.com.google.protobuf.CodedOutputStream
19+ .computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
20+ };
21+ __size += unknownFields.serializedSize
22+ __size
23+ }
24+ override def serializedSize : _root_.scala.Int = {
25+ var __size = __serializedSizeMemoized
26+ if (__size == 0 ) {
27+ __size = __computeSerializedSize() + 1
28+ __serializedSizeMemoized = __size
3929 }
40- def getMyAny : com.google.protobuf.any.Any = myAny.getOrElse(com.google.protobuf.any.Any .defaultInstance)
41- def clearMyAny : MyContainer = copy(myAny = _root_.scala.None )
42- def withMyAny (__v : com.google.protobuf.any.Any ): MyContainer = copy(myAny = _root_.scala.Option (__v))
43- def withUnknownFields (__v : _root_.scalapb.UnknownFieldSet ) = copy(unknownFields = __v)
44- def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet .empty)
45- def getFieldByNumber (__fieldNumber : _root_.scala.Int ): _root_.scala.Any = {
46- (__fieldNumber : @ _root_.scala.unchecked) match {
47- case 1 => myAny.orNull
48- }
30+ __size - 1
31+
32+ }
33+ def writeTo (`_output__` : _root_.com.google.protobuf.CodedOutputStream ): _root_.scala.Unit = {
34+ myAny.foreach { __v =>
35+ val __m = __v
36+ _output__.writeTag(1 , 2 )
37+ _output__.writeUInt32NoTag(__m.serializedSize)
38+ __m.writeTo(_output__)
39+ };
40+ unknownFields.writeTo(_output__)
41+ }
42+ def getMyAny : com.google.protobuf.any.Any =
43+ myAny.getOrElse(com.google.protobuf.any.Any .defaultInstance)
44+ def clearMyAny : MyContainer = copy(myAny = _root_.scala.None )
45+ def withMyAny (__v : com.google.protobuf.any.Any ): MyContainer =
46+ copy(myAny = _root_.scala.Option (__v))
47+ def withUnknownFields (__v : _root_.scalapb.UnknownFieldSet ) = copy(unknownFields = __v)
48+ def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet .empty)
49+ def getFieldByNumber (__fieldNumber : _root_.scala.Int ): _root_.scala.Any = {
50+ (__fieldNumber : @ _root_.scala.unchecked) match {
51+ case 1 => myAny.orNull
4952 }
50- def getField (__field : _root_.scalapb.descriptors.FieldDescriptor ): _root_.scalapb.descriptors.PValue = {
51- _root_.scala.Predef .require(__field.containingMessage eq companion.scalaDescriptor)
52- (__field.number: @ _root_.scala.unchecked) match {
53- case 1 => myAny.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty )
54- }
53+ }
54+ def getField (
55+ __field : _root_.scalapb.descriptors.FieldDescriptor
56+ ): _root_.scalapb.descriptors.PValue = {
57+ _root_.scala.Predef .require(__field.containingMessage eq companion.scalaDescriptor)
58+ (__field.number: @ _root_.scala.unchecked) match {
59+ case 1 => myAny.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty )
5560 }
56- def toProtoString : _root_.scala.Predef .String = _root_.scalapb.TextFormat .printToUnicodeString(this )
57- def companion : com.thesamet.docs.json.MyContainer .type = com.thesamet.docs.json.MyContainer
58- // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyContainer])
61+ }
62+ def toProtoString : _root_.scala.Predef .String =
63+ _root_.scalapb.TextFormat .printToUnicodeString(this )
64+ def companion : com.thesamet.docs.json.MyContainer .type = com.thesamet.docs.json.MyContainer
65+ // @@protoc_insertion_point(GeneratedMessage[com.thesamet.docs.MyContainer])
5966}
6067
6168object MyContainer extends scalapb.GeneratedMessageCompanion [com.thesamet.docs.json.MyContainer ] {
62- implicit def messageCompanion : scalapb.GeneratedMessageCompanion [com.thesamet.docs.json.MyContainer ] = this
63- def parseFrom (`_input__` : _root_.com.google.protobuf.CodedInputStream ): com.thesamet.docs.json.MyContainer = {
64- var __myAny : _root_.scala.Option [com.google.protobuf.any.Any ] = _root_.scala.None
69+ implicit def messageCompanion
70+ : scalapb.GeneratedMessageCompanion [com.thesamet.docs.json.MyContainer ] = this
71+ def parseFrom (
72+ `_input__` : _root_.com.google.protobuf.CodedInputStream
73+ ): com.thesamet.docs.json.MyContainer = {
74+ var __myAny : _root_.scala.Option [com.google.protobuf.any.Any ] = _root_.scala.None
6575 var `_unknownFields__` : _root_.scalapb.UnknownFieldSet .Builder = null
66- var _done__ = false
76+ var _done__ = false
6777 while (! _done__) {
6878 val _tag__ = _input__.readTag()
6979 _tag__ match {
7080 case 0 => _done__ = true
7181 case 10 =>
72- __myAny = _root_.scala.Option (__myAny.fold(_root_.scalapb.LiteParser .readMessage[com.google.protobuf.any.Any ](_input__))(_root_.scalapb.LiteParser .readMessage(_input__, _)))
82+ __myAny = _root_.scala.Option (
83+ __myAny.fold(
84+ _root_.scalapb.LiteParser .readMessage[com.google.protobuf.any.Any ](_input__)
85+ )(_root_.scalapb.LiteParser .readMessage(_input__, _))
86+ )
7387 case tag =>
7488 if (_unknownFields__ == null ) {
7589 _unknownFields__ = new _root_.scalapb.UnknownFieldSet .Builder ()
@@ -78,39 +92,60 @@ object MyContainer extends scalapb.GeneratedMessageCompanion[com.thesamet.docs.j
7892 }
7993 }
8094 com.thesamet.docs.json.MyContainer (
81- myAny = __myAny,
82- unknownFields = if (_unknownFields__ == null ) _root_.scalapb.UnknownFieldSet .empty else _unknownFields__.result()
95+ myAny = __myAny,
96+ unknownFields =
97+ if (_unknownFields__ == null ) _root_.scalapb.UnknownFieldSet .empty
98+ else _unknownFields__.result()
8399 )
84100 }
85- implicit def messageReads : _root_.scalapb.descriptors.Reads [com.thesamet.docs.json.MyContainer ] = _root_.scalapb.descriptors.Reads {
86- case _root_.scalapb.descriptors.PMessage (__fieldsMap) =>
87- _root_.scala.Predef .require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), " FieldDescriptor does not match message type." )
88- com.thesamet.docs.json.MyContainer (
89- myAny = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1 ).get).flatMap(_.as[_root_.scala.Option [com.google.protobuf.any.Any ]])
90- )
91- case _ => throw new RuntimeException (" Expected PMessage" )
92- }
93- def javaDescriptor : _root_.com.google.protobuf.Descriptors .Descriptor = com.thesamet.docs.json.JsonProto .javaDescriptor.getMessageTypes().get(1 )
94- def scalaDescriptor : _root_.scalapb.descriptors.Descriptor = com.thesamet.docs.json.JsonProto .scalaDescriptor.messages(1 )
95- def messageCompanionForFieldNumber (__number : _root_.scala.Int ): _root_.scalapb.GeneratedMessageCompanion [_] = {
96- var __out : _root_.scalapb.GeneratedMessageCompanion [_] = null
97- (__number : @ _root_.scala.unchecked) match {
101+ implicit def messageReads : _root_.scalapb.descriptors.Reads [com.thesamet.docs.json.MyContainer ] =
102+ _root_.scalapb.descriptors.Reads {
103+ case _root_.scalapb.descriptors.PMessage (__fieldsMap) =>
104+ _root_.scala.Predef .require(
105+ __fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor),
106+ " FieldDescriptor does not match message type."
107+ )
108+ com.thesamet.docs.json.MyContainer (
109+ myAny = __fieldsMap
110+ .get(scalaDescriptor.findFieldByNumber(1 ).get)
111+ .flatMap(_.as[_root_.scala.Option [com.google.protobuf.any.Any ]])
112+ )
113+ case _ => throw new RuntimeException (" Expected PMessage" )
114+ }
115+ def javaDescriptor : _root_.com.google.protobuf.Descriptors .Descriptor =
116+ com.thesamet.docs.json.JsonProto .javaDescriptor.getMessageTypes().get(1 )
117+ def scalaDescriptor : _root_.scalapb.descriptors.Descriptor =
118+ com.thesamet.docs.json.JsonProto .scalaDescriptor.messages(1 )
119+ def messageCompanionForFieldNumber (
120+ __number : _root_.scala.Int
121+ ): _root_.scalapb.GeneratedMessageCompanion [? ] = {
122+ var __out : _root_.scalapb.GeneratedMessageCompanion [? ] = null
123+ (__number : @ _root_.scala.unchecked) match {
98124 case 1 => __out = com.google.protobuf.any.Any
99125 }
100126 __out
101127 }
102- lazy val nestedMessagesCompanions : Seq [_root_.scalapb.GeneratedMessageCompanion [_ <: _root_.scalapb.GeneratedMessage ]] = Seq .empty
103- def enumCompanionForFieldNumber (__fieldNumber : _root_.scala.Int ): _root_.scalapb.GeneratedEnumCompanion [_] = throw new MatchError (__fieldNumber)
128+ lazy val nestedMessagesCompanions
129+ : Seq [_root_.scalapb.GeneratedMessageCompanion [? <: _root_.scalapb.GeneratedMessage ]] =
130+ Seq .empty
131+ def enumCompanionForFieldNumber (
132+ __fieldNumber : _root_.scala.Int
133+ ): _root_.scalapb.GeneratedEnumCompanion [? ] = throw new MatchError (__fieldNumber)
104134 lazy val defaultInstance = com.thesamet.docs.json.MyContainer (
105135 myAny = _root_.scala.None
106136 )
107- 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) {
108- def myAny : _root_.scalapb.lenses.Lens [UpperPB , com.google.protobuf.any.Any ] = field(_.getMyAny)((c_, f_) => c_.copy(myAny = _root_.scala.Option (f_)))
109- def optionalMyAny : _root_.scalapb.lenses.Lens [UpperPB , _root_.scala.Option [com.google.protobuf.any.Any ]] = field(_.myAny)((c_, f_) => c_.copy(myAny = f_))
137+ implicit class MyContainerLens [UpperPB ](
138+ _l : _root_.scalapb.lenses.Lens [UpperPB , com.thesamet.docs.json.MyContainer ]
139+ ) extends _root_.scalapb.lenses.ObjectLens [UpperPB , com.thesamet.docs.json.MyContainer ](_l) {
140+ def myAny : _root_.scalapb.lenses.Lens [UpperPB , com.google.protobuf.any.Any ] =
141+ field(_.getMyAny)((c_, f_) => c_.copy(myAny = _root_.scala.Option (f_)))
142+ def optionalMyAny
143+ : _root_.scalapb.lenses.Lens [UpperPB , _root_.scala.Option [com.google.protobuf.any.Any ]] =
144+ field(_.myAny)((c_, f_) => c_.copy(myAny = f_))
110145 }
111146 final val MY_ANY_FIELD_NUMBER = 1
112147 def of (
113- myAny : _root_.scala.Option [com.google.protobuf.any.Any ]
148+ myAny : _root_.scala.Option [com.google.protobuf.any.Any ]
114149 ): _root_.com.thesamet.docs.json.MyContainer = _root_.com.thesamet.docs.json.MyContainer (
115150 myAny
116151 )
0 commit comments