# Class LazyField (3.19.4)

    public class LazyField extends LazyFieldLite

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](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite) but this class can contain a
default instance of the message to provide `hashCode()`, `equals()`, and `
toString()`.

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [LazyFieldLite](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite) \> LazyField

## Inherited Members

[LazyFieldLite.clear()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_clear__) [LazyFieldLite.containsDefaultInstance()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_containsDefaultInstance__) [LazyFieldLite.ensureInitialized(MessageLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_ensureInitialized_com_google_protobuf_MessageLite_) [LazyFieldLite.equals(Object)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_equals_java_lang_Object_) [LazyFieldLite.fromValue(MessageLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_fromValue_com_google_protobuf_MessageLite_) [LazyFieldLite.getSerializedSize()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_getSerializedSize__) [LazyFieldLite.getValue(MessageLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_getValue_com_google_protobuf_MessageLite_) [LazyFieldLite.hashCode()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_hashCode__) [LazyFieldLite.merge(LazyFieldLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_merge_com_google_protobuf_LazyFieldLite_) [LazyFieldLite.mergeFrom(CodedInputStream,ExtensionRegistryLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_) [LazyFieldLite.set(LazyFieldLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_set_com_google_protobuf_LazyFieldLite_) [LazyFieldLite.setByteString(ByteString,ExtensionRegistryLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_setByteString_com_google_protobuf_ByteString_com_google_protobuf_ExtensionRegistryLite_) [LazyFieldLite.setValue(MessageLite)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_setValue_com_google_protobuf_MessageLite_) [LazyFieldLite.toByteString()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_toByteString__) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)

    public LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `defaultInstance` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageLite` |
| `extensionRegistry` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite` |
| `bytes` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString` |

## Methods

### containsDefaultInstance()

    public boolean containsDefaultInstance()

Determines whether this LazyFieldLite instance represents the default instance of this type.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [LazyFieldLite.containsDefaultInstance()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_containsDefaultInstance__)

### equals(Object obj)

    public boolean equals(Object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [LazyFieldLite.equals(Object o)](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_equals_java_lang_Object_)

### getValue()

    public MessageLite getValue()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageLite` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [LazyFieldLite.hashCode()](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.LazyFieldLite#com_google_protobuf_LazyFieldLite_hashCode__)

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)