AbstractMessage.java
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 package com.google.protobuf;
32 
37 import java.io.IOException;
38 import java.io.InputStream;
39 import java.util.Arrays;
40 import java.util.Collections;
41 import java.util.HashMap;
42 import java.util.Iterator;
43 import java.util.List;
44 import java.util.Map;
45 
52 public abstract class AbstractMessage
53  // TODO(dweis): Update GeneratedMessage to parameterize with MessageType and BuilderType.
54  extends AbstractMessageLite implements Message {
55 
56  @Override
57  public boolean isInitialized() {
58  return MessageReflection.isInitialized(this);
59  }
60 
65  protected interface BuilderParent {
66 
78  void markDirty();
79  }
80 
83  throw new UnsupportedOperationException("Nested builder is not supported for this type.");
84  }
85 
86 
87  @Override
88  public List<String> findInitializationErrors() {
89  return MessageReflection.findMissingFields(this);
90  }
91 
92  @Override
93  public String getInitializationErrorString() {
94  return MessageReflection.delimitWithCommas(findInitializationErrors());
95  }
96 
98  @Override
99  public boolean hasOneof(OneofDescriptor oneof) {
100  throw new UnsupportedOperationException("hasOneof() is not implemented.");
101  }
102 
104  @Override
106  throw new UnsupportedOperationException("getOneofFieldDescriptor() is not implemented.");
107  }
108 
109  @Override
110  public final String toString() {
111  return TextFormat.printer().printToString(this);
112  }
113 
114  @Override
115  public void writeTo(final CodedOutputStream output) throws IOException {
116  MessageReflection.writeMessageTo(this, getAllFields(), output, false);
117  }
118 
119  protected int memoizedSize = -1;
120 
121  @Override
122  int getMemoizedSerializedSize() {
123  return memoizedSize;
124  }
125 
126  @Override
127  void setMemoizedSerializedSize(int size) {
128  memoizedSize = size;
129  }
130 
131  @Override
132  public int getSerializedSize() {
133  int size = memoizedSize;
134  if (size != -1) {
135  return size;
136  }
137 
138  memoizedSize = MessageReflection.getSerializedSize(this, getAllFields());
139  return memoizedSize;
140  }
141 
142  @Override
143  public boolean equals(final Object other) {
144  if (other == this) {
145  return true;
146  }
147  if (!(other instanceof Message)) {
148  return false;
149  }
150  final Message otherMessage = (Message) other;
151  if (getDescriptorForType() != otherMessage.getDescriptorForType()) {
152  return false;
153  }
154  return compareFields(getAllFields(), otherMessage.getAllFields())
155  && getUnknownFields().equals(otherMessage.getUnknownFields());
156  }
157 
158  @Override
159  public int hashCode() {
160  int hash = memoizedHashCode;
161  if (hash == 0) {
162  hash = 41;
163  hash = (19 * hash) + getDescriptorForType().hashCode();
164  hash = hashFields(hash, getAllFields());
165  hash = (29 * hash) + getUnknownFields().hashCode();
166  memoizedHashCode = hash;
167  }
168  return hash;
169  }
170 
171  private static ByteString toByteString(Object value) {
172  if (value instanceof byte[]) {
173  return ByteString.copyFrom((byte[]) value);
174  } else {
175  return (ByteString) value;
176  }
177  }
178 
183  private static boolean compareBytes(Object a, Object b) {
184  if (a instanceof byte[] && b instanceof byte[]) {
185  return Arrays.equals((byte[]) a, (byte[]) b);
186  }
187  return toByteString(a).equals(toByteString(b));
188  }
189 
191  @SuppressWarnings({"rawtypes", "unchecked"})
192  private static Map convertMapEntryListToMap(List list) {
193  if (list.isEmpty()) {
194  return Collections.emptyMap();
195  }
196  Map result = new HashMap();
197  Iterator iterator = list.iterator();
198  Message entry = (Message) iterator.next();
200  Descriptors.FieldDescriptor key = descriptor.findFieldByName("key");
201  Descriptors.FieldDescriptor value = descriptor.findFieldByName("value");
202  Object fieldValue = entry.getField(value);
203  if (fieldValue instanceof EnumValueDescriptor) {
204  fieldValue = ((EnumValueDescriptor) fieldValue).getNumber();
205  }
206  result.put(entry.getField(key), fieldValue);
207  while (iterator.hasNext()) {
208  entry = (Message) iterator.next();
209  fieldValue = entry.getField(value);
210  if (fieldValue instanceof EnumValueDescriptor) {
211  fieldValue = ((EnumValueDescriptor) fieldValue).getNumber();
212  }
213  result.put(entry.getField(key), fieldValue);
214  }
215  return result;
216  }
217 
219  @SuppressWarnings({"rawtypes", "unchecked"})
220  private static boolean compareMapField(Object a, Object b) {
221  Map ma = convertMapEntryListToMap((List) a);
222  Map mb = convertMapEntryListToMap((List) b);
223  return MapFieldLite.equals(ma, mb);
224  }
225 
233  static boolean compareFields(Map<FieldDescriptor, Object> a, Map<FieldDescriptor, Object> b) {
234  if (a.size() != b.size()) {
235  return false;
236  }
237  for (FieldDescriptor descriptor : a.keySet()) {
238  if (!b.containsKey(descriptor)) {
239  return false;
240  }
241  Object value1 = a.get(descriptor);
242  Object value2 = b.get(descriptor);
243  if (descriptor.getType() == FieldDescriptor.Type.BYTES) {
244  if (descriptor.isRepeated()) {
245  List list1 = (List) value1;
246  List list2 = (List) value2;
247  if (list1.size() != list2.size()) {
248  return false;
249  }
250  for (int i = 0; i < list1.size(); i++) {
251  if (!compareBytes(list1.get(i), list2.get(i))) {
252  return false;
253  }
254  }
255  } else {
256  // Compares a singular bytes field.
257  if (!compareBytes(value1, value2)) {
258  return false;
259  }
260  }
261  } else if (descriptor.isMapField()) {
262  if (!compareMapField(value1, value2)) {
263  return false;
264  }
265  } else {
266  // Compare non-bytes fields.
267  if (!value1.equals(value2)) {
268  return false;
269  }
270  }
271  }
272  return true;
273  }
274 
276  @SuppressWarnings("unchecked")
277  private static int hashMapField(Object value) {
278  return MapFieldLite.calculateHashCodeForMap(convertMapEntryListToMap((List) value));
279  }
280 
282  @SuppressWarnings("unchecked")
283  protected static int hashFields(int hash, Map<FieldDescriptor, Object> map) {
284  for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
285  FieldDescriptor field = entry.getKey();
286  Object value = entry.getValue();
287  hash = (37 * hash) + field.getNumber();
288  if (field.isMapField()) {
289  hash = (53 * hash) + hashMapField(value);
290  } else if (field.getType() != FieldDescriptor.Type.ENUM) {
291  hash = (53 * hash) + value.hashCode();
292  } else if (field.isRepeated()) {
293  List<? extends EnumLite> list = (List<? extends EnumLite>) value;
294  hash = (53 * hash) + Internal.hashEnumList(list);
295  } else {
296  hash = (53 * hash) + Internal.hashEnum((EnumLite) value);
297  }
298  }
299  return hash;
300  }
301 
306  @Override
307  UninitializedMessageException newUninitializedMessageException() {
308  return Builder.newUninitializedMessageException(this);
309  }
310 
311  // =================================================================
312 
317  @SuppressWarnings("unchecked")
318  public abstract static class Builder<BuilderType extends Builder<BuilderType>>
319  extends AbstractMessageLite.Builder implements Message.Builder {
320  // The compiler produces an error if this is not declared explicitly.
321  // Method isn't abstract to bypass Java 1.6 compiler issue:
322  // http://bugs.java.com/view_bug.do?bug_id=6908259
323  @Override
324  public BuilderType clone() {
325  throw new UnsupportedOperationException("clone() should be implemented in subclasses.");
326  }
327 
329  @Override
330  public boolean hasOneof(OneofDescriptor oneof) {
331  throw new UnsupportedOperationException("hasOneof() is not implemented.");
332  }
333 
335  @Override
337  throw new UnsupportedOperationException("getOneofFieldDescriptor() is not implemented.");
338  }
339 
341  @Override
342  public BuilderType clearOneof(OneofDescriptor oneof) {
343  throw new UnsupportedOperationException("clearOneof() is not implemented.");
344  }
345 
346  @Override
347  public BuilderType clear() {
348  for (final Map.Entry<FieldDescriptor, Object> entry : getAllFields().entrySet()) {
349  clearField(entry.getKey());
350  }
351  return (BuilderType) this;
352  }
353 
354  @Override
355  public List<String> findInitializationErrors() {
356  return MessageReflection.findMissingFields(this);
357  }
358 
359  @Override
361  return MessageReflection.delimitWithCommas(findInitializationErrors());
362  }
363 
364  @Override
365  protected BuilderType internalMergeFrom(AbstractMessageLite other) {
366  return mergeFrom((Message) other);
367  }
368 
369  @Override
370  public BuilderType mergeFrom(final Message other) {
371  return mergeFrom(other, other.getAllFields());
372  }
373 
374  BuilderType mergeFrom(final Message other, Map<FieldDescriptor, Object> allFields) {
375  if (other.getDescriptorForType() != getDescriptorForType()) {
376  throw new IllegalArgumentException(
377  "mergeFrom(Message) can only merge messages of the same type.");
378  }
379 
380  // Note: We don't attempt to verify that other's fields have valid
381  // types. Doing so would be a losing battle. We'd have to verify
382  // all sub-messages as well, and we'd have to make copies of all of
383  // them to insure that they don't change after verification (since
384  // the Message interface itself cannot enforce immutability of
385  // implementations).
386  // TODO(kenton): Provide a function somewhere called makeDeepCopy()
387  // which allows people to make secure deep copies of messages.
388 
389  for (final Map.Entry<FieldDescriptor, Object> entry : allFields.entrySet()) {
390  final FieldDescriptor field = entry.getKey();
391  if (field.isRepeated()) {
392  for (final Object element : (List) entry.getValue()) {
393  addRepeatedField(field, element);
394  }
395  } else if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
396  final Message existingValue = (Message) getField(field);
397  if (existingValue == existingValue.getDefaultInstanceForType()) {
398  setField(field, entry.getValue());
399  } else {
400  setField(
401  field,
402  existingValue
404  .mergeFrom(existingValue)
405  .mergeFrom((Message) entry.getValue())
406  .build());
407  }
408  } else {
409  setField(field, entry.getValue());
410  }
411  }
412 
413  mergeUnknownFields(other.getUnknownFields());
414 
415  return (BuilderType) this;
416  }
417 
418  @Override
419  public BuilderType mergeFrom(final CodedInputStream input) throws IOException {
420  return mergeFrom(input, ExtensionRegistry.getEmptyRegistry());
421  }
422 
423  @Override
424  public BuilderType mergeFrom(
425  final CodedInputStream input, final ExtensionRegistryLite extensionRegistry)
426  throws IOException {
427  boolean discardUnknown = input.shouldDiscardUnknownFields();
428  final UnknownFieldSet.Builder unknownFields =
429  discardUnknown ? null : UnknownFieldSet.newBuilder(getUnknownFields());
430  while (true) {
431  final int tag = input.readTag();
432  if (tag == 0) {
433  break;
434  }
435 
436  MessageReflection.BuilderAdapter builderAdapter =
437  new MessageReflection.BuilderAdapter(this);
438  if (!MessageReflection.mergeFieldFrom(
439  input, unknownFields, extensionRegistry, getDescriptorForType(), builderAdapter, tag)) {
440  // end group tag
441  break;
442  }
443  }
444  if (unknownFields != null) {
445  setUnknownFields(unknownFields.build());
446  }
447  return (BuilderType) this;
448  }
449 
450  @Override
451  public BuilderType mergeUnknownFields(final UnknownFieldSet unknownFields) {
452  setUnknownFields(
453  UnknownFieldSet.newBuilder(getUnknownFields()).mergeFrom(unknownFields).build());
454  return (BuilderType) this;
455  }
456 
457  @Override
459  throw new UnsupportedOperationException(
460  "getFieldBuilder() called on an unsupported message type.");
461  }
462 
463  @Override
465  throw new UnsupportedOperationException(
466  "getRepeatedFieldBuilder() called on an unsupported message type.");
467  }
468 
469  @Override
470  public String toString() {
471  return TextFormat.printer().printToString(this);
472  }
473 
476  Message message) {
477  return new UninitializedMessageException(MessageReflection.findMissingFields(message));
478  }
479 
488  void markClean() {
489  throw new IllegalStateException("Should be overridden by subclasses.");
490  }
491 
499  void dispose() {
500  throw new IllegalStateException("Should be overridden by subclasses.");
501  }
502 
503  // ===============================================================
504  // The following definitions seem to be required in order to make javac
505  // not produce weird errors like:
506  //
507  // java/com/google/protobuf/DynamicMessage.java:203: types
508  // com.google.protobuf.AbstractMessage.Builder<
509  // com.google.protobuf.DynamicMessage.Builder> and
510  // com.google.protobuf.AbstractMessage.Builder<
511  // com.google.protobuf.DynamicMessage.Builder> are incompatible; both
512  // define mergeFrom(com.google.protobuf.ByteString), but with unrelated
513  // return types.
514  //
515  // Strangely, these lines are only needed if javac is invoked separately
516  // on AbstractMessage.java and AbstractMessageLite.java. If javac is
517  // invoked on both simultaneously, it works. (Or maybe the important
518  // point is whether or not DynamicMessage.java is compiled together with
519  // AbstractMessageLite.java -- not sure.) I suspect this is a compiler
520  // bug.
521 
522  @Override
523  public BuilderType mergeFrom(final ByteString data) throws InvalidProtocolBufferException {
524  return (BuilderType) super.mergeFrom(data);
525  }
526 
527  @Override
528  public BuilderType mergeFrom(
529  final ByteString data, final ExtensionRegistryLite extensionRegistry)
531  return (BuilderType) super.mergeFrom(data, extensionRegistry);
532  }
533 
534  @Override
535  public BuilderType mergeFrom(final byte[] data) throws InvalidProtocolBufferException {
536  return (BuilderType) super.mergeFrom(data);
537  }
538 
539  @Override
540  public BuilderType mergeFrom(final byte[] data, final int off, final int len)
542  return (BuilderType) super.mergeFrom(data, off, len);
543  }
544 
545  @Override
546  public BuilderType mergeFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry)
548  return (BuilderType) super.mergeFrom(data, extensionRegistry);
549  }
550 
551  @Override
552  public BuilderType mergeFrom(
553  final byte[] data,
554  final int off,
555  final int len,
556  final ExtensionRegistryLite extensionRegistry)
558  return (BuilderType) super.mergeFrom(data, off, len, extensionRegistry);
559  }
560 
561  @Override
562  public BuilderType mergeFrom(final InputStream input) throws IOException {
563  return (BuilderType) super.mergeFrom(input);
564  }
565 
566  @Override
567  public BuilderType mergeFrom(
568  final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
569  return (BuilderType) super.mergeFrom(input, extensionRegistry);
570  }
571 
572  @Override
573  public boolean mergeDelimitedFrom(final InputStream input) throws IOException {
574  return super.mergeDelimitedFrom(input);
575  }
576 
577  @Override
578  public boolean mergeDelimitedFrom(
579  final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
580  return super.mergeDelimitedFrom(input, extensionRegistry);
581  }
582  }
583 
588  @Deprecated
589  protected static int hashLong(long n) {
590  return (int) (n ^ (n >>> 32));
591  }
592  //
597  @Deprecated
598  protected static int hashBoolean(boolean b) {
599  return b ? 1231 : 1237;
600  }
601  //
606  @Deprecated
607  protected static int hashEnum(EnumLite e) {
608  return e.getNumber();
609  }
610  //
615  @Deprecated
616  protected static int hashEnumList(List<? extends EnumLite> list) {
617  int hash = 1;
618  for (EnumLite e : list) {
619  hash = 31 * hash + hashEnum(e);
620  }
621  return hash;
622  }
623 }
com.google.protobuf.Descriptors
Definition: Descriptors.java:80
Map
struct Map Map
Definition: php/ext/google/protobuf/protobuf.h:648
com.google.protobuf.AbstractMessage.Builder
Definition: AbstractMessage.java:318
com.google.protobuf.MessageOrBuilder.getField
Object getField(Descriptors.FieldDescriptor field)
com.google.protobuf.Internal.hashEnumList
static int hashEnumList(List<? extends EnumLite > list)
Definition: Internal.java:249
com.google.protobuf.Internal.hashEnum
static int hashEnum(EnumLite e)
Definition: Internal.java:244
com.google.protobuf.AbstractMessageLite.memoizedHashCode
int memoizedHashCode
Definition: AbstractMessageLite.java:53
com.google.protobuf.AbstractMessage.writeTo
void writeTo(final CodedOutputStream output)
Definition: AbstractMessage.java:115
com.google.protobuf.AbstractMessage.Builder.mergeDelimitedFrom
boolean mergeDelimitedFrom(final InputStream input)
Definition: AbstractMessage.java:573
com.google.protobuf.AbstractMessage.hashCode
int hashCode()
Definition: AbstractMessage.java:159
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final CodedInputStream input)
Definition: AbstractMessage.java:419
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:546
com.google.protobuf.MapFieldLite.equals
static boolean equals(Object a, Object b)
Definition: MapFieldLite.java:125
com.google.protobuf.AbstractMessage.BuilderParent.markDirty
void markDirty()
input
std::string input
Definition: tokenizer_unittest.cc:197
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final InputStream input)
Definition: AbstractMessage.java:562
com.google.protobuf.MessageOrBuilder.getUnknownFields
UnknownFieldSet getUnknownFields()
com.google.protobuf.AbstractMessage.hashLong
static int hashLong(long n)
Definition: AbstractMessage.java:589
com.google.protobuf.AbstractMessage.hashBoolean
static int hashBoolean(boolean b)
Definition: AbstractMessage.java:598
com.google.protobuf.MessageOrBuilder.getAllFields
Map< Descriptors.FieldDescriptor, Object > getAllFields()
com.google.protobuf.AbstractMessage.toByteString
static ByteString toByteString(Object value)
Definition: AbstractMessage.java:171
com.google.protobuf
Definition: ProtoCaliperBenchmark.java:2
descriptor
Descriptor * descriptor
Definition: php/ext/google/protobuf/protobuf.h:936
com.google.protobuf.Message.newBuilderForType
Builder newBuilderForType()
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:473
com.google.protobuf.AbstractMessage.equals
boolean equals(final Object other)
Definition: AbstractMessage.java:143
com.google.protobuf.AbstractMessage.toString
final String toString()
Definition: AbstractMessage.java:110
com.google.protobuf.Descriptors.FieldDescriptor.Type
Definition: Descriptors.java:1215
com.google.protobuf.UninitializedMessageException
Definition: UninitializedMessageException.java:47
com.google.protobuf.AbstractMessage.Builder.mergeUnknownFields
BuilderType mergeUnknownFields(final UnknownFieldSet unknownFields)
Definition: AbstractMessage.java:451
com.google.protobuf.AbstractMessage.hashEnum
static int hashEnum(EnumLite e)
Definition: AbstractMessage.java:607
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final byte[] data, final int off, final int len, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:552
b
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:3228
com.google.protobuf.UnknownFieldSet.newBuilder
static Builder newBuilder()
Definition: UnknownFieldSet.java:66
FieldDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:129
com.google.protobuf.AbstractMessage.Builder.mergeDelimitedFrom
boolean mergeDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:578
com.google.protobuf.MessageOrBuilder.getDescriptorForType
Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.AbstractMessage.Builder.findInitializationErrors
List< String > findInitializationErrors()
Definition: AbstractMessage.java:355
com.google.protobuf.CodedInputStream
Definition: CodedInputStream.java:61
com.google.protobuf.Descriptors.OneofDescriptor
Definition: Descriptors.java:2597
com.google.protobuf.AbstractMessage.memoizedSize
int memoizedSize
Definition: AbstractMessage.java:119
com.google.protobuf.AbstractMessage.compareBytes
static boolean compareBytes(Object a, Object b)
Definition: AbstractMessage.java:183
com.google.protobuf.AbstractMessage.getOneofFieldDescriptor
FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof)
Definition: AbstractMessage.java:105
com.google.protobuf.Message.Builder
Definition: Message.java:104
com.google.protobuf.UnknownFieldSet
Definition: UnknownFieldSet.java:58
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:567
com.google.protobuf.AbstractMessage.Builder.hasOneof
boolean hasOneof(OneofDescriptor oneof)
Definition: AbstractMessage.java:330
com.google.protobuf.Internal.EnumLite
Definition: Internal.java:199
com.google.protobuf.AbstractMessage.getInitializationErrorString
String getInitializationErrorString()
Definition: AbstractMessage.java:93
com.google.protobuf.UnknownFieldSet.equals
boolean equals(final Object other)
Definition: UnknownFieldSet.java:104
com.google.protobuf.AbstractMessageLite
Definition: AbstractMessageLite.java:49
EnumValueDescriptor
struct EnumValueDescriptor EnumValueDescriptor
Definition: php/ext/google/protobuf/protobuf.h:634
com.google.protobuf.AbstractMessage.convertMapEntryListToMap
static Map convertMapEntryListToMap(List list)
Definition: AbstractMessage.java:192
com.google.protobuf.AbstractMessage.Builder.getRepeatedFieldBuilder
Message.Builder getRepeatedFieldBuilder(final FieldDescriptor field, int index)
Definition: AbstractMessage.java:464
com.google.protobuf.AbstractMessage.Builder.clear
BuilderType clear()
Definition: AbstractMessage.java:347
size
#define size
Definition: glcorearb.h:2944
com.google.protobuf.AbstractMessage.Builder.getInitializationErrorString
String getInitializationErrorString()
Definition: AbstractMessage.java:360
com.google.protobuf.Message.Builder.build
Message build()
com.google.protobuf.ExtensionRegistryLite
Definition: ExtensionRegistryLite.java:70
com.google.protobuf.UnknownFieldSet.Builder
Definition: UnknownFieldSet.java:308
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
com.google.protobuf.ExtensionRegistry.getEmptyRegistry
static ExtensionRegistry getEmptyRegistry()
Definition: ExtensionRegistry.java:98
com.google.protobuf.AbstractMessage.Builder.clearOneof
BuilderType clearOneof(OneofDescriptor oneof)
Definition: AbstractMessage.java:342
n
GLdouble n
Definition: glcorearb.h:4153
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final ByteString data)
Definition: AbstractMessage.java:523
Builder
Definition: ruby/ext/google/protobuf_c/protobuf.h:162
i
int i
Definition: gmock-matchers_test.cc:764
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final Message other)
Definition: AbstractMessage.java:370
com.google.protobuf.TextFormat.printer
static Printer printer()
Definition: TextFormat.java:280
java
com.google.protobuf.Descriptors.Descriptor
Definition: Descriptors.java:629
com.google.protobuf.AbstractMessage.Builder.internalMergeFrom
BuilderType internalMergeFrom(AbstractMessageLite other)
Definition: AbstractMessage.java:365
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final byte[] data, final int off, final int len)
Definition: AbstractMessage.java:540
len
int len
Definition: php/ext/google/protobuf/map.c:206
com.google.protobuf.AbstractMessage.compareMapField
static boolean compareMapField(Object a, Object b)
Definition: AbstractMessage.java:220
com.google.protobuf.AbstractMessage.hashEnumList
static int hashEnumList(List<? extends EnumLite > list)
Definition: AbstractMessage.java:616
com.google.protobuf.AbstractMessage.Builder.toString
String toString()
Definition: AbstractMessage.java:470
size
GLsizeiptr size
Definition: glcorearb.h:2943
com.google.protobuf.MapFieldLite
Definition: MapFieldLite.java:47
com.google
com.google.protobuf.UnknownFieldSet.hashCode
int hashCode()
Definition: UnknownFieldSet.java:112
com
com.google.protobuf.AbstractMessage.isInitialized
boolean isInitialized()
Definition: AbstractMessage.java:57
com.google.protobuf.AbstractMessage.newBuilderForType
Message.Builder newBuilderForType(BuilderParent parent)
Definition: AbstractMessage.java:82
com.google.protobuf.AbstractMessage.Builder.newUninitializedMessageException
static UninitializedMessageException newUninitializedMessageException(Message message)
Definition: AbstractMessage.java:475
com.google.protobuf.ExtensionRegistry
Definition: ExtensionRegistry.java:91
com.google.protobuf.AbstractMessageLite.toByteString
ByteString toByteString()
Definition: AbstractMessageLite.java:56
com.google.protobuf.AbstractMessage
Definition: AbstractMessage.java:52
com.google.protobuf.TextFormat.Printer.printToString
String printToString(final MessageOrBuilder message)
Definition: TextFormat.java:441
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
com.google.protobuf.Internal
Definition: Internal.java:54
com.google.protobuf.AbstractMessage.BuilderParent
Definition: AbstractMessage.java:65
com.google.protobuf.CodedOutputStream
Definition: CodedOutputStream.java:59
com.google.protobuf.InvalidProtocolBufferException
Definition: InvalidProtocolBufferException.java:41
com.google.protobuf.Descriptors.EnumValueDescriptor
Definition: Descriptors.java:1774
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
com.google.protobuf.AbstractMessage.getSerializedSize
int getSerializedSize()
Definition: AbstractMessage.java:132
com.google.protobuf.Internal.EnumLite.getNumber
int getNumber()
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final byte[] data)
Definition: AbstractMessage.java:535
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
com.google.protobuf.AbstractMessage.Builder.getFieldBuilder
Message.Builder getFieldBuilder(final FieldDescriptor field)
Definition: AbstractMessage.java:458
com.google.protobuf.AbstractMessage.hasOneof
boolean hasOneof(OneofDescriptor oneof)
Definition: AbstractMessage.java:99
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:424
index
GLuint index
Definition: glcorearb.h:3055
com.google.protobuf.AbstractMessage.findInitializationErrors
List< String > findInitializationErrors()
Definition: AbstractMessage.java:88
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
com.google.protobuf.AbstractMessage.hashMapField
static int hashMapField(Object value)
Definition: AbstractMessage.java:277
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
com.google.protobuf.Message
Definition: Message.java:50
com.google.protobuf.AbstractMessage.Builder.mergeFrom
BuilderType mergeFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry)
Definition: AbstractMessage.java:528
com.google.protobuf.AbstractMessage.Builder.clone
BuilderType clone()
Definition: AbstractMessage.java:324
com.google.protobuf.TextFormat
Definition: TextFormat.java:55
com.google.protobuf.AbstractMessage.hashFields
static int hashFields(int hash, Map< FieldDescriptor, Object > map)
Definition: AbstractMessage.java:283
com.google.protobuf.AbstractMessage.Builder.getOneofFieldDescriptor
FieldDescriptor getOneofFieldDescriptor(OneofDescriptor oneof)
Definition: AbstractMessage.java:336
com.google.protobuf.Descriptors.FieldDescriptor.Type.ENUM
ENUM
Definition: Descriptors.java:1229
com.google.protobuf.Descriptors.FieldDescriptor
Definition: Descriptors.java:949
com.google.protobuf.ByteString
Definition: ByteString.java:67


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:47