Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Member Functions | List of all members
com.google.protobuf.AbstractMessage Class Referenceabstract
Inheritance diagram for com.google.protobuf.AbstractMessage:
Inheritance graph
[legend]

Classes

class  Builder
 
interface  BuilderParent
 

Public Member Functions

boolean equals (final Object other)
 
List< String > findInitializationErrors ()
 
String getInitializationErrorString ()
 
FieldDescriptor getOneofFieldDescriptor (OneofDescriptor oneof)
 
int getSerializedSize ()
 
int hashCode ()
 
boolean hasOneof (OneofDescriptor oneof)
 
boolean isInitialized ()
 
final String toString ()
 
void writeTo (final CodedOutputStream output) throws IOException
 
- Public Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
byte[] toByteArray ()
 
ByteString toByteString ()
 
void writeDelimitedTo (final OutputStream output) throws IOException
 
void writeTo (final OutputStream output) throws IOException
 
- Public Member Functions inherited from com.google.protobuf.Message
Parser<? extends MessagegetParserForType ()
 
Builder newBuilderForType ()
 
Builder toBuilder ()
 
- Public Member Functions inherited from com.google.protobuf.MessageOrBuilder
Map< Descriptors.FieldDescriptor, Object > getAllFields ()
 
Message getDefaultInstanceForType ()
 
Descriptors.Descriptor getDescriptorForType ()
 
Object getField (Descriptors.FieldDescriptor field)
 
Descriptors.FieldDescriptor getOneofFieldDescriptor (Descriptors.OneofDescriptor oneof)
 
Object getRepeatedField (Descriptors.FieldDescriptor field, int index)
 
int getRepeatedFieldCount (Descriptors.FieldDescriptor field)
 
UnknownFieldSet getUnknownFields ()
 
boolean hasField (Descriptors.FieldDescriptor field)
 
boolean hasOneof (Descriptors.OneofDescriptor oneof)
 

Protected Member Functions

Message.Builder newBuilderForType (BuilderParent parent)
 

Static Protected Member Functions

static int hashBoolean (boolean b)
 
static int hashEnum (EnumLite e)
 
static int hashEnumList (List<? extends EnumLite > list)
 
static int hashFields (int hash, Map< FieldDescriptor, Object > map)
 
static int hashLong (long n)
 
- Static Protected Member Functions inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
static< T > void addAll (final Iterable< T > values, final Collection<? super T > list)
 
static< T > void addAll (final Iterable< T > values, final List<? super T > list)
 
static void checkByteStringIsUtf8 (ByteString byteString) throws IllegalArgumentException
 

Protected Attributes

int memoizedSize = -1
 
- Protected Attributes inherited from com.google.protobuf.AbstractMessageLite< MessageType extends AbstractMessageLite< MessageType, BuilderType, BuilderType extends AbstractMessageLite.Builder< MessageType, BuilderType >
int memoizedHashCode = 0
 

Static Private Member Functions

static boolean compareBytes (Object a, Object b)
 
static boolean compareMapField (Object a, Object b)
 
static Map convertMapEntryListToMap (List list)
 
static int hashMapField (Object value)
 
static ByteString toByteString (Object value)
 

Detailed Description

A partial implementation of the Message interface which implements as many methods of that interface as possible in terms of other methods.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Definition at line 52 of file AbstractMessage.java.

Member Function Documentation

◆ compareBytes()

static boolean com.google.protobuf.AbstractMessage.compareBytes ( Object  a,
Object  b 
)
inlinestaticprivate

Compares two bytes fields. The parameters must be either a byte array or a ByteString object. They can be of different type though.

Definition at line 183 of file AbstractMessage.java.

◆ compareMapField()

static boolean com.google.protobuf.AbstractMessage.compareMapField ( Object  a,
Object  b 
)
inlinestaticprivate

Compares two map fields. The parameters must be a list of MapEntry messages.

Definition at line 220 of file AbstractMessage.java.

◆ convertMapEntryListToMap()

static Map com.google.protobuf.AbstractMessage.convertMapEntryListToMap ( List  list)
inlinestaticprivate

Converts a list of MapEntry messages into a Map used for equals() and hashCode().

Definition at line 192 of file AbstractMessage.java.

◆ equals()

boolean com.google.protobuf.AbstractMessage.equals ( final Object  other)
inline

Compares the specified object with this message for equality. Returns

true

if the given object is a message of the same type (as defined by

) and has identical values for all of its fields. Subclasses must implement this; inheriting

Object.equals()

is incorrect.

Parameters
otherobject to be compared for equality with this message
Returns
true
if the specified object is equal to this message

Implements com.google.protobuf.Message.

Definition at line 143 of file AbstractMessage.java.

◆ findInitializationErrors()

List<String> com.google.protobuf.AbstractMessage.findInitializationErrors ( )
inline

Returns a list of field paths (e.g. "foo.bar.baz") of required fields which are not set in this message. You should call MessageLiteOrBuilder#isInitialized() first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 88 of file AbstractMessage.java.

◆ getInitializationErrorString()

String com.google.protobuf.AbstractMessage.getInitializationErrorString ( )
inline

Returns a comma-delimited list of required fields which are not set in this message object. You should call MessageLiteOrBuilder#isInitialized() first to check if there are any missing fields, as that method is likely to be much faster than this one even when the message is fully-initialized.

Implements com.google.protobuf.MessageOrBuilder.

Definition at line 93 of file AbstractMessage.java.

◆ getOneofFieldDescriptor()

FieldDescriptor com.google.protobuf.AbstractMessage.getOneofFieldDescriptor ( OneofDescriptor  oneof)
inline

TODO(jieluo): Clear it when all subclasses have implemented this method.

Reimplemented in com.google.protobuf.DynamicMessage, com.google.protobuf.GeneratedMessageV3, and com.google.protobuf.GeneratedMessage.

Definition at line 105 of file AbstractMessage.java.

◆ getSerializedSize()

int com.google.protobuf.AbstractMessage.getSerializedSize ( )
inline

Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.

Implements com.google.protobuf.MessageLite.

Reimplemented in com.google.protobuf.GeneratedMessageV3, com.google.protobuf.GeneratedMessage, com.google.protobuf.DynamicMessage, and com.google.protobuf.MapEntry< K, V >.

Definition at line 132 of file AbstractMessage.java.

◆ hashBoolean()

static int com.google.protobuf.AbstractMessage.hashBoolean ( boolean  b)
inlinestaticprotected
Deprecated:
from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.

Definition at line 598 of file AbstractMessage.java.

◆ hashCode()

int com.google.protobuf.AbstractMessage.hashCode ( )
inline

Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting

Object.hashCode()

is incorrect.

Returns
the hash code value for this message
See also
Map::hashCode()

Implements com.google.protobuf.Message.

Definition at line 159 of file AbstractMessage.java.

◆ hashEnum()

static int com.google.protobuf.AbstractMessage.hashEnum ( EnumLite  e)
inlinestaticprotected
Deprecated:
from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.

Definition at line 607 of file AbstractMessage.java.

◆ hashEnumList()

static int com.google.protobuf.AbstractMessage.hashEnumList ( List<? extends EnumLite list)
inlinestaticprotected
Deprecated:
from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.

Definition at line 616 of file AbstractMessage.java.

◆ hashFields()

static int com.google.protobuf.AbstractMessage.hashFields ( int  hash,
Map< FieldDescriptor, Object >  map 
)
inlinestaticprotected

Get a hash code for given fields and values, using the given seed.

Definition at line 283 of file AbstractMessage.java.

◆ hashLong()

static int com.google.protobuf.AbstractMessage.hashLong ( long  n)
inlinestaticprotected
Deprecated:
from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1 generated code.

Definition at line 589 of file AbstractMessage.java.

◆ hashMapField()

static int com.google.protobuf.AbstractMessage.hashMapField ( Object  value)
inlinestaticprivate

Calculates the hash code of a map field.

must be a list of MapEntry messages.

Definition at line 277 of file AbstractMessage.java.

◆ hasOneof()

boolean com.google.protobuf.AbstractMessage.hasOneof ( OneofDescriptor  oneof)
inline

TODO(jieluo): Clear it when all subclasses have implemented this method.

Reimplemented in com.google.protobuf.DynamicMessage, com.google.protobuf.GeneratedMessageV3, and com.google.protobuf.GeneratedMessage.

Definition at line 99 of file AbstractMessage.java.

◆ isInitialized()

boolean com.google.protobuf.AbstractMessage.isInitialized ( )
inline

◆ newBuilderForType()

Message.Builder com.google.protobuf.AbstractMessage.newBuilderForType ( BuilderParent  parent)
inlineprotected

Create a nested builder.

Definition at line 82 of file AbstractMessage.java.

◆ toByteString()

static ByteString com.google.protobuf.AbstractMessage.toByteString ( Object  value)
inlinestaticprivate

Definition at line 171 of file AbstractMessage.java.

◆ toString()

final String com.google.protobuf.AbstractMessage.toString ( )
inline

Converts the message to a string in protocol buffer text format. This is just a trivial wrapper around TextFormat.Printer#printToString(MessageOrBuilder).

Implements com.google.protobuf.Message.

Definition at line 110 of file AbstractMessage.java.

◆ writeTo()

void com.google.protobuf.AbstractMessage.writeTo ( final CodedOutputStream  output) throws IOException
inline

Serializes the message and writes it to

. This does not flush or close the stream.

Implements com.google.protobuf.MessageLite.

Reimplemented in com.google.protobuf.GeneratedMessageV3, com.google.protobuf.GeneratedMessage, com.google.protobuf.DynamicMessage, and com.google.protobuf.MapEntry< K, V >.

Definition at line 115 of file AbstractMessage.java.

Member Data Documentation

◆ memoizedSize

int com.google.protobuf.AbstractMessage.memoizedSize = -1
protected

Definition at line 119 of file AbstractMessage.java.


The documentation for this class was generated from the following file:
com.google.protobuf.MessageOrBuilder.getDescriptorForType
Descriptors.Descriptor getDescriptorForType()
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503


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