Package com.google.protobuf
Class LazyField
- java.lang.Object
-
- com.google.protobuf.LazyFieldLite
-
- com.google.protobuf.LazyField
-
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
but this class can contain a default instance of the message to providehashCode()
,equals()
, andtoString()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LazyField.LazyEntry<K>
LazyEntry and LazyIterator are used to encapsulate the LazyField, when users iterate all fields from FieldSet.(package private) static class
LazyField.LazyIterator<K>
-
Field Summary
Fields Modifier and Type Field Description private MessageLite
defaultInstance
Carry a message's default instance which is used byhashCode()
,equals()
, andtoString()
.-
Fields inherited from class com.google.protobuf.LazyFieldLite
value
-
-
Constructor Summary
Constructors Constructor Description LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsDefaultInstance()
Determines whether this LazyFieldLite instance represents the default instance of this type.boolean
equals(java.lang.Object obj)
MessageLite
getValue()
int
hashCode()
java.lang.String
toString()
-
Methods inherited from class com.google.protobuf.LazyFieldLite
clear, ensureInitialized, fromValue, getSerializedSize, getValue, merge, mergeFrom, set, setByteString, setValue, toByteString, writeTo
-
-
-
-
Field Detail
-
defaultInstance
private final MessageLite defaultInstance
Carry a message's default instance which is used byhashCode()
,equals()
, andtoString()
.
-
-
Constructor Detail
-
LazyField
public LazyField(MessageLite defaultInstance, ExtensionRegistryLite extensionRegistry, ByteString bytes)
-
-
Method Detail
-
containsDefaultInstance
public boolean containsDefaultInstance()
Description copied from class:LazyFieldLite
Determines whether this LazyFieldLite instance represents the default instance of this type.- Overrides:
containsDefaultInstance
in classLazyFieldLite
-
getValue
public MessageLite getValue()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classLazyFieldLite
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classLazyFieldLite
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-