google-protobuf 4.31.1-java → 4.32.0.rc.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 801a14007485edfbc640324ff3b09c39c44d44c62ac7b1094bf527000ecc9f28
4
- data.tar.gz: a45f822d4b2ec341122a231150988a467530ffae1220cf8379a5c1e19b946410
3
+ metadata.gz: 1409c414d01e032ec4b2a251fe55d77f10413d27f0a427fafa70f3f9d5080144
4
+ data.tar.gz: 5bc4ded6f387aa0558a4310be8feecf3d3ea63b2075ec1d28f10de225828c38b
5
5
  SHA512:
6
- metadata.gz: 71a2a33c4e71717b5bb432f1b636a46e43bbaf634af2975a60f22e4705407b25f25349bee0127e2bc31fa7b3a8b51c93117d3c05476383cc692e1c359fe40b99
7
- data.tar.gz: 25c7c642ab4829b748149b2bed60b65da20e1789e9ff74dfb03360b5e8c107211782bb9a21b70a2aa0f0497aa3c1943d202d8530c3d516035e599b0d159dce52
6
+ metadata.gz: 5f1d0ebba8102a2254c33e0f218bf8d97f4c1a01276f15fc5ebea3aab21945701810c9b01ab45754a82f748214ed22a92116b43f68a22f43c019c77e4a7b116b
7
+ data.tar.gz: fe6b2f548e0ec061a3f80c26b7430705ad8f38aca6fa8a806c8cc4fd5ed4389c22c910ced1ec20a4fa84fd204b6543ca03242cf61977eee61b5d9915be9d997e
@@ -420,11 +420,10 @@ static VALUE Message_field_accessor(VALUE _self, const upb_FieldDef* f,
420
420
  }
421
421
 
422
422
  /*
423
- * call-seq:
424
- * Message.method_missing(*args)
423
+ * ruby-doc: AbstractMessage
425
424
  *
426
- * Provides accessors and setters and methods to clear and check for presence of
427
- * message fields according to their field names.
425
+ * The {AbstractMessage} class is the parent class for all Protobuf messages,
426
+ * and is generated from C code.
428
427
  *
429
428
  * For any field whose name does not conflict with a built-in method, an
430
429
  * accessor is provided with the same name as the field, and a setter is
@@ -653,16 +652,12 @@ void Message_InitFromValue(upb_Message* msg, const upb_MessageDef* m, VALUE val,
653
652
  }
654
653
 
655
654
  /*
656
- * call-seq:
657
- * Message.new(kwargs) => new_message
655
+ * ruby-doc: AbstractMessage#initialize
658
656
  *
659
657
  * Creates a new instance of the given message class. Keyword arguments may be
660
658
  * provided with keywords corresponding to field names.
661
659
  *
662
- * Note that no literal Message class exists. Only concrete classes per message
663
- * type exist, as provided by the #msgclass method on Descriptors after they
664
- * have been added to a pool. The method definitions described here on the
665
- * Message class are provided on each concrete message class.
660
+ * @param kwargs the list of field keys and values.
666
661
  */
667
662
  static VALUE Message_initialize(int argc, VALUE* argv, VALUE _self) {
668
663
  Message* self = ruby_to_Message(_self);
@@ -684,10 +679,11 @@ static VALUE Message_initialize(int argc, VALUE* argv, VALUE _self) {
684
679
  }
685
680
 
686
681
  /*
687
- * call-seq:
688
- * Message.dup => new_message
682
+ * ruby-doc: AbstractMessage#dup
689
683
  *
690
684
  * Performs a shallow copy of this message and returns the new copy.
685
+ *
686
+ * @return [AbstractMessage]
691
687
  */
692
688
  static VALUE Message_dup(VALUE _self) {
693
689
  Message* self = ruby_to_Message(_self);
@@ -700,13 +696,15 @@ static VALUE Message_dup(VALUE _self) {
700
696
  }
701
697
 
702
698
  /*
703
- * call-seq:
704
- * Message.==(other) => boolean
699
+ * ruby-doc: AbstractMessage#==
705
700
  *
706
701
  * Performs a deep comparison of this message with another. Messages are equal
707
702
  * if they have the same type and if each field is equal according to the :==
708
703
  * method's semantics (a more efficient comparison may actually be done if the
709
704
  * field is of a primitive type).
705
+ *
706
+ * @param other [AbstractMessage]
707
+ * @return [Boolean]
710
708
  */
711
709
  static VALUE Message_eq(VALUE _self, VALUE _other) {
712
710
  if (CLASS_OF(_self) != CLASS_OF(_other)) return Qfalse;
@@ -735,10 +733,11 @@ uint64_t Message_Hash(const upb_Message* msg, const upb_MessageDef* m,
735
733
  }
736
734
 
737
735
  /*
738
- * call-seq:
739
- * Message.hash => hash_value
736
+ * ruby-doc: AbstractMessage#hash
740
737
  *
741
738
  * Returns a hash value that represents this message's field values.
739
+ *
740
+ * @return [Integer]
742
741
  */
743
742
  static VALUE Message_hash(VALUE _self) {
744
743
  Message* self = ruby_to_Message(_self);
@@ -749,12 +748,13 @@ static VALUE Message_hash(VALUE _self) {
749
748
  }
750
749
 
751
750
  /*
752
- * call-seq:
753
- * Message.inspect => string
751
+ * ruby-doc: AbstractMessage#inspect
754
752
  *
755
753
  * Returns a human-readable string representing this message. It will be
756
754
  * formatted as "<MessageType: field1: value1, field2: value2, ...>". Each
757
755
  * field's value is represented according to its own #inspect method.
756
+ *
757
+ * @return [String]
758
758
  */
759
759
  static VALUE Message_inspect(VALUE _self) {
760
760
  Message* self = ruby_to_Message(_self);
@@ -830,10 +830,11 @@ VALUE Scalar_CreateHash(upb_MessageValue msgval, TypeInfo type_info) {
830
830
  }
831
831
 
832
832
  /*
833
- * call-seq:
834
- * Message.to_h => {}
833
+ * ruby-doc: AbstractMessage#to_h
835
834
  *
836
835
  * Returns the message as a Ruby Hash object, with keys as symbols.
836
+ *
837
+ * @return [Hash]
837
838
  */
838
839
  static VALUE Message_to_h(VALUE _self) {
839
840
  Message* self = ruby_to_Message(_self);
@@ -841,12 +842,13 @@ static VALUE Message_to_h(VALUE _self) {
841
842
  }
842
843
 
843
844
  /*
844
- * call-seq:
845
- * Message.frozen? => bool
845
+ * ruby-doc: AbstractMessage#frozen?
846
846
  *
847
847
  * Returns true if the message is frozen in either Ruby or the underlying
848
848
  * representation. Freezes the Ruby message object if it is not already frozen
849
849
  * in Ruby but it is frozen in the underlying representation.
850
+ *
851
+ * @return [Boolean]
850
852
  */
851
853
  VALUE Message_frozen(VALUE _self) {
852
854
  Message* self = ruby_to_Message(_self);
@@ -861,11 +863,12 @@ VALUE Message_frozen(VALUE _self) {
861
863
  }
862
864
 
863
865
  /*
864
- * call-seq:
865
- * Message.freeze => self
866
+ * ruby-doc: AbstractMessage#freeze
866
867
  *
867
868
  * Freezes the message object. We have to intercept this so we can freeze the
868
869
  * underlying representation, not just the Ruby wrapper.
870
+ *
871
+ * @return [self]
869
872
  */
870
873
  VALUE Message_freeze(VALUE _self) {
871
874
  Message* self = ruby_to_Message(_self);
@@ -882,11 +885,13 @@ VALUE Message_freeze(VALUE _self) {
882
885
  }
883
886
 
884
887
  /*
885
- * call-seq:
886
- * Message.[](index) => value
888
+ * ruby-doc: AbstractMessage#[]
887
889
  *
888
890
  * Accesses a field's value by field name. The provided field name should be a
889
891
  * string.
892
+ *
893
+ * @param index [Integer]
894
+ * @return [Object]
890
895
  */
891
896
  static VALUE Message_index(VALUE _self, VALUE field_name) {
892
897
  Message* self = ruby_to_Message(_self);
@@ -903,11 +908,14 @@ static VALUE Message_index(VALUE _self, VALUE field_name) {
903
908
  }
904
909
 
905
910
  /*
906
- * call-seq:
907
- * Message.[]=(index, value)
911
+ * ruby-doc: AbstractMessage#[]=
908
912
  *
909
913
  * Sets a field's value by field name. The provided field name should be a
910
914
  * string.
915
+ *
916
+ * @param index [Integer]
917
+ * @param value [Object]
918
+ * @return [nil]
911
919
  */
912
920
  static VALUE Message_index_set(VALUE _self, VALUE field_name, VALUE value) {
913
921
  Message* self = ruby_to_Message(_self);
@@ -929,14 +937,16 @@ static VALUE Message_index_set(VALUE _self, VALUE field_name, VALUE value) {
929
937
  }
930
938
 
931
939
  /*
932
- * call-seq:
933
- * MessageClass.decode(data, options) => message
940
+ * ruby-doc: AbstractMessage.decode
934
941
  *
935
942
  * Decodes the given data (as a string containing bytes in protocol buffers wire
936
943
  * format) under the interpretation given by this message class's definition
937
944
  * and returns a message object with the corresponding field values.
938
- * @param options [Hash] options for the decoder
939
- * recursion_limit: set to maximum decoding depth for message (default is 64)
945
+ * @param data [String]
946
+ * @param options [Hash]
947
+ * @option recursion_limit [Integer] set to maximum decoding depth for message
948
+ * (default is 64)
949
+ * @return [AbstractMessage]
940
950
  */
941
951
  static VALUE Message_decode(int argc, VALUE* argv, VALUE klass) {
942
952
  VALUE data = argv[0];
@@ -989,16 +999,17 @@ VALUE Message_decode_bytes(int size, const char* bytes, int options,
989
999
  }
990
1000
 
991
1001
  /*
992
- * call-seq:
993
- * MessageClass.decode_json(data, options = {}) => message
1002
+ * ruby-doc: AbstractMessage.decode_json
994
1003
  *
995
1004
  * Decodes the given data (as a string containing bytes in protocol buffers wire
996
1005
  * format) under the interpretration given by this message class's definition
997
1006
  * and returns a message object with the corresponding field values.
998
1007
  *
999
- * @param options [Hash] options for the decoder
1000
- * ignore_unknown_fields: set true to ignore unknown fields (default is to
1001
- * raise an error)
1008
+ * @param data [String]
1009
+ * @param options [Hash]
1010
+ * @option ignore_unknown_fields [Boolean] set true to ignore unknown fields
1011
+ * (default is to raise an error)
1012
+ * @return [AbstractMessage]
1002
1013
  */
1003
1014
  static VALUE Message_decode_json(int argc, VALUE* argv, VALUE klass) {
1004
1015
  VALUE data = argv[0];
@@ -1057,13 +1068,16 @@ static VALUE Message_decode_json(int argc, VALUE* argv, VALUE klass) {
1057
1068
  }
1058
1069
 
1059
1070
  /*
1060
- * call-seq:
1061
- * MessageClass.encode(msg, options) => bytes
1071
+ * ruby-doc: AbstractMessage.encode
1062
1072
  *
1063
1073
  * Encodes the given message object to its serialized form in protocol buffers
1064
1074
  * wire format.
1065
- * @param options [Hash] options for the encoder
1066
- * recursion_limit: set to maximum encoding depth for message (default is 64)
1075
+ *
1076
+ * @param msg [AbstractMessage]
1077
+ * @param options [Hash]
1078
+ * @option recursion_limit [Integer] set to maximum encoding depth for message
1079
+ * (default is 64)
1080
+ * @return [String]
1067
1081
  */
1068
1082
  static VALUE Message_encode(int argc, VALUE* argv, VALUE klass) {
1069
1083
  Message* msg = ruby_to_Message(argv[0]);
@@ -1110,14 +1124,17 @@ static VALUE Message_encode(int argc, VALUE* argv, VALUE klass) {
1110
1124
  }
1111
1125
 
1112
1126
  /*
1113
- * call-seq:
1114
- * MessageClass.encode_json(msg, options = {}) => json_string
1127
+ * ruby-doc: AbstractMessage.encode_json
1115
1128
  *
1116
1129
  * Encodes the given message object into its serialized JSON representation.
1117
- * @param options [Hash] options for the decoder
1118
- * preserve_proto_fieldnames: set true to use original fieldnames (default is
1119
- * to camelCase) emit_defaults: set true to emit 0/false values (default is to
1120
- * omit them)
1130
+ *
1131
+ * @param msg [AbstractMessage]
1132
+ * @param options [Hash]
1133
+ * @option preserve_proto_fieldnames [Boolean] set true to use original
1134
+ * fieldnames (default is to camelCase)
1135
+ * @option emit_defaults [Boolean] set true to emit 0/false values (default is
1136
+ * to omit them)
1137
+ * @return [String]
1121
1138
  */
1122
1139
  static VALUE Message_encode_json(int argc, VALUE* argv, VALUE klass) {
1123
1140
  Message* msg = ruby_to_Message(argv[0]);
@@ -1185,11 +1202,12 @@ static VALUE Message_encode_json(int argc, VALUE* argv, VALUE klass) {
1185
1202
  }
1186
1203
 
1187
1204
  /*
1188
- * call-seq:
1189
- * Message.descriptor => descriptor
1205
+ * ruby-doc: AbstractMessage.descriptor
1190
1206
  *
1191
1207
  * Class method that returns the Descriptor instance corresponding to this
1192
1208
  * message class's type.
1209
+ *
1210
+ * @return [Descriptor]
1193
1211
  */
1194
1212
  static VALUE Message_descriptor(VALUE klass) {
1195
1213
  return rb_ivar_get(klass, descriptor_instancevar_interned);
@@ -1212,12 +1230,26 @@ VALUE build_class_from_descriptor(VALUE descriptor) {
1212
1230
  return klass;
1213
1231
  }
1214
1232
 
1233
+ /* ruby-doc: Enum
1234
+ *
1235
+ * There isn't really a concrete `Enum` module generated by Protobuf. Instead,
1236
+ * you can use this documentation as an indicator of methods that are defined on
1237
+ * each `Enum` module that is generated. E.g. if you have:
1238
+ *
1239
+ * enum my_enum_type
1240
+ *
1241
+ * in your Proto file and generate Ruby code, a module
1242
+ * called `MyEnumType` will be generated with the following methods available.
1243
+ */
1244
+
1215
1245
  /*
1216
- * call-seq:
1217
- * Enum.lookup(number) => name
1246
+ * ruby-doc: Enum.lookup
1218
1247
  *
1219
1248
  * This module method, provided on each generated enum module, looks up an enum
1220
1249
  * value by number and returns its name as a Ruby symbol, or nil if not found.
1250
+ *
1251
+ * @param number [Integer]
1252
+ * @return [String]
1221
1253
  */
1222
1254
  static VALUE enum_lookup(VALUE self, VALUE number) {
1223
1255
  int32_t num = NUM2INT(number);
@@ -1232,11 +1264,13 @@ static VALUE enum_lookup(VALUE self, VALUE number) {
1232
1264
  }
1233
1265
 
1234
1266
  /*
1235
- * call-seq:
1236
- * Enum.resolve(name) => number
1267
+ * ruby-doc: Enum.resolve
1237
1268
  *
1238
1269
  * This module method, provided on each generated enum module, looks up an enum
1239
1270
  * value by name (as a Ruby symbol) and returns its name, or nil if not found.
1271
+ *
1272
+ * @param name [String]
1273
+ * @return [Integer]
1240
1274
  */
1241
1275
  static VALUE enum_resolve(VALUE self, VALUE sym) {
1242
1276
  const char* name = rb_id2name(SYM2ID(sym));
@@ -1251,11 +1285,13 @@ static VALUE enum_resolve(VALUE self, VALUE sym) {
1251
1285
  }
1252
1286
 
1253
1287
  /*
1254
- * call-seq:
1255
- * Enum.descriptor
1288
+ * ruby-doc: Enum.descriptor
1256
1289
  *
1257
1290
  * This module method, provided on each generated enum module, returns the
1258
- * EnumDescriptor corresponding to this enum type.
1291
+ * {EnumDescriptor} corresponding to this enum type.
1292
+ *
1293
+ * @return [EnumDescriptor]
1294
+ *
1259
1295
  */
1260
1296
  static VALUE enum_descriptor(VALUE self) {
1261
1297
  return rb_ivar_get(self, descriptor_instancevar_interned);
@@ -183,7 +183,7 @@ const rb_data_type_t Arena_type = {
183
183
  };
184
184
 
185
185
  static void *ruby_upb_allocfunc(upb_alloc *alloc, void *ptr, size_t oldsize,
186
- size_t size) {
186
+ size_t size, size_t *actual_size) {
187
187
  if (size == 0) {
188
188
  xfree(ptr);
189
189
  return NULL;
@@ -97,6 +97,4 @@ void Protobuf_CheckNotFrozen(VALUE val, bool upb_frozen);
97
97
 
98
98
  #define PBRUBY_MAX(x, y) (((x) > (y)) ? (x) : (y))
99
99
 
100
- #define UPB_UNUSED(var) (void)var
101
-
102
100
  #endif // __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__