Stay organized with collections
Save and categorize content based on your preferences.
publicclassLazyFieldextendsLazyFieldLite
LazyField encapsulates the logic of lazily parsing message fields. It stores the message in a
ByteString initially and then parses it on-demand.
Most methods are implemented in LazyFieldLite but this class can contain a
default instance of the message to provide hashCode(), equals(), and
toString().
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class LazyField (3.19.4)\n\n public class LazyField extends LazyFieldLite\n\nLazyField encapsulates the logic of lazily parsing message fields. It stores the message in a\nByteString initially and then parses it on-demand.\n\nMost methods are implemented in [LazyFieldLite](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite) but this class can contain a\ndefault instance of the message to provide `hashCode()`, `equals()`, and `\ntoString()`. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [LazyFieldLite](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite) \\\u003e LazyField \n\nInherited Members\n-----------------\n\n[LazyFieldLite.clear()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_clear__) \n[LazyFieldLite.containsDefaultInstance()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_containsDefaultInstance__) \n[LazyFieldLite.ensureInitialized(MessageLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_ensureInitialized_com_google_protobuf_MessageLite_) \n[LazyFieldLite.equals(Object)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_equals_java_lang_Object_) \n[LazyFieldLite.fromValue(MessageLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_fromValue_com_google_protobuf_MessageLite_) \n[LazyFieldLite.getSerializedSize()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_getSerializedSize__) \n[LazyFieldLite.getValue(MessageLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_getValue_com_google_protobuf_MessageLite_) \n[LazyFieldLite.hashCode()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_hashCode__) \n[LazyFieldLite.merge(LazyFieldLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_merge_com_google_protobuf_LazyFieldLite_) \n[LazyFieldLite.mergeFrom(CodedInputStream,ExtensionRegistryLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_) \n[LazyFieldLite.set(LazyFieldLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_set_com_google_protobuf_LazyFieldLite_) \n[LazyFieldLite.setByteString(ByteString,ExtensionRegistryLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_setByteString_com_google_protobuf_ByteString_com_google_protobuf_ExtensionRegistryLite_) \n[LazyFieldLite.setValue(MessageLite)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_setValue_com_google_protobuf_MessageLite_) \n[LazyFieldLite.toByteString()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_toByteString__) \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \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.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\nConstructors\n------------\n\n### LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)\n\n public LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)\n\nMethods\n-------\n\n### containsDefaultInstance()\n\n public boolean containsDefaultInstance()\n\nDetermines whether this LazyFieldLite instance represents the default instance of this type.\n\n**Overrides** \n[LazyFieldLite.containsDefaultInstance()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_containsDefaultInstance__)\n\n### equals(Object obj)\n\n public boolean equals(Object obj)\n\n**Overrides** \n[LazyFieldLite.equals(Object o)](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_equals_java_lang_Object_)\n\n### getValue()\n\n public MessageLite getValue()\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[LazyFieldLite.hashCode()](/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_hashCode__)\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]