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 getDescriptorForType()) and has
identical values for all of its fields. Subclasses must implement this; inheriting
Object.equals() is incorrect.
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.
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.
Get the number of bytes required to encode this message. The result is only computed on the
first call and memoized after that.
If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will
be smaller than the actual number of bytes required and might be negative.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class AbstractMessage (3.19.4)\n\n public abstract class AbstractMessage extends AbstractMessageLite implements Message\n\nA partial implementation of the [Message](/java/docs/reference/protobuf/latest/com.google.protobuf.Message) interface which implements as many methods of\nthat interface as possible in terms of other methods. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [AbstractMessageLite](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite) \\\u003e AbstractMessage \n\nImplements\n----------\n\n[Message](/java/docs/reference/protobuf/latest/com.google.protobuf.Message) \n\nInherited Members\n-----------------\n\n[AbstractMessageLite.\\\u003cT\\\u003eaddAll(Iterable\\\u003cT\\\u003e,Collection\\\u003c? super T\\\u003e)](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite__T_addAll_java_lang_Iterable_T__java_util_Collection___super_T__) \n[AbstractMessageLite.\\\u003cT\\\u003eaddAll(Iterable\\\u003cT\\\u003e,List\\\u003c? super T\\\u003e)](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite__T_addAll_java_lang_Iterable_T__java_util_List___super_T__) \n[AbstractMessageLite.checkByteStringIsUtf8(ByteString)](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite_checkByteStringIsUtf8_com_google_protobuf_ByteString_) \n[AbstractMessageLite.toByteArray()](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite_toByteArray__) \n[AbstractMessageLite.toByteString()](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite_toByteString__) \n[AbstractMessageLite.writeDelimitedTo(OutputStream)](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite_writeDelimitedTo_java_io_OutputStream_) \n[AbstractMessageLite.writeTo(OutputStream)](/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite#com_google_protobuf_AbstractMessageLite_writeTo_java_io_OutputStream_) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### hashBoolean(boolean b) (deprecated)\n\n protected static int hashBoolean(boolean b)\n\n**Deprecated.** *from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1\ngenerated code.*\n\n### hashEnum(Internal.EnumLite e) (deprecated)\n\n protected static int hashEnum(Internal.EnumLite e)\n\n**Deprecated.** *from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1\ngenerated code.*\n\n### hashEnumList(List\\\u003c? extends Internal.EnumLite\\\u003e list) (deprecated)\n\n protected static int hashEnumList(List\u003c? extends Internal.EnumLite\u003e list)\n\n**Deprecated.** *from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1\ngenerated code.*\n\n### hashFields(int hash, Map\\\u003cDescriptors.FieldDescriptor,Object\\\u003e map)\n\n protected static int hashFields(int hash, Map\u003cDescriptors.FieldDescriptor,Object\u003e map)\n\nGet a hash code for given fields and values, using the given seed.\n\n### hashLong(long n) (deprecated)\n\n protected static int hashLong(long n)\n\n**Deprecated.** *from v3.0.0-beta-3+, for compatibility with v2.5.0 and v2.6.1\ngenerated code.*\n\nConstructors\n------------\n\n### AbstractMessage()\n\n public AbstractMessage()\n\nFields\n------\n\n### memoizedSize\n\n protected int memoizedSize\n\nMethods\n-------\n\n### equals(Object other)\n\n public boolean equals(Object other)\n\nCompares the specified object with this message for equality. Returns `true` if the given\nobject is a message of the same type (as defined by `getDescriptorForType()`) and has\nidentical values for all of its fields. Subclasses must implement this; inheriting `\nObject.equals()` is incorrect.\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### findInitializationErrors()\n\n public List\u003cString\u003e findInitializationErrors()\n\nReturns a list of field paths (e.g. \"foo.bar.baz\") of required fields which are not set in this\nmessage. You should call [MessageLiteOrBuilder#isInitialized()](/java/docs/reference/protobuf/latest/com.google.protobuf.MessageLiteOrBuilder#com_google_protobuf_MessageLiteOrBuilder_isInitialized__) first to check if there\nare any missing fields, as that method is likely to be much faster than this one even when the\nmessage is fully-initialized.\n\n### getInitializationErrorString()\n\n public String getInitializationErrorString()\n\nReturns a comma-delimited list of required fields which are not set in this message object. You\nshould call [MessageLiteOrBuilder#isInitialized()](/java/docs/reference/protobuf/latest/com.google.protobuf.MessageLiteOrBuilder#com_google_protobuf_MessageLiteOrBuilder_isInitialized__) first to check if there are any\nmissing fields, as that method is likely to be much faster than this one even when the message\nis fully-initialized.\n\n### getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)\n\n public Descriptors.FieldDescriptor getOneofFieldDescriptor(Descriptors.OneofDescriptor oneof)\n\nTODO(jieluo): Clear it when all subclasses have implemented this method.\n\n### getSerializedSize()\n\n public int getSerializedSize()\n\nGet the number of bytes required to encode this message. The result is only computed on the\nfirst call and memoized after that.\n\nIf this message requires more than Integer.MAX_VALUE bytes to encode, the return value will\nbe smaller than the actual number of bytes required and might be negative.\n\n### hasOneof(Descriptors.OneofDescriptor oneof)\n\n public boolean hasOneof(Descriptors.OneofDescriptor oneof)\n\nTODO(jieluo): Clear it when all subclasses have implemented this method.\n\n### hashCode()\n\n public int hashCode()\n\nReturns the hash code value for this message. The hash code of a message should mix the\nmessage's type (object identity of the descriptor) with its contents (known and unknown field\nvalues). Subclasses must implement this; inheriting `Object.hashCode()` is incorrect.\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### isInitialized()\n\n public boolean isInitialized()\n\nReturns true if all required fields in the message and all embedded messages are set, false\notherwise.\n\nSee also: [MessageOrBuilder#getInitializationErrorString()](/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder#com_google_protobuf_MessageOrBuilder_getInitializationErrorString__)\n\n### newBuilderForType(AbstractMessage.BuilderParent parent)\n\n protected Message.Builder newBuilderForType(AbstractMessage.BuilderParent parent)\n\nCreate a nested builder.\n\n### toString()\n\n public final String toString()\n\nConverts the message to a string in protocol buffer text format. This is just a trivial wrapper\naround [TextFormat.Printer#printToString(MessageOrBuilder)](/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormat.Printer#com_google_protobuf_TextFormat_Printer_printToString_com_google_protobuf_MessageOrBuilder_).\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)\n\n### writeTo(CodedOutputStream output)\n\n public void writeTo(CodedOutputStream output)\n\nSerializes the message and writes it to `output`. This does not flush or close the\nstream."]]