public abstract static class GeneratedMessageLite.Builder<MessageType,BuilderType> extends AbstractMessageLite.Builder<MessageType,BuilderType>
Inheritance
java.lang.Object > AbstractMessageLite.Builder > GeneratedMessageLite.Builder<MessageType,BuilderType>Type Parameters | |
---|---|
Name | Description |
MessageType | |
BuilderType |
Constructors
Builder(MessageType defaultInstance)
protected Builder(MessageType defaultInstance)
Parameter | |
---|---|
Name | Description |
defaultInstance | MessageType |
Fields
instance
protected MessageType instance
Field Value | |
---|---|
Type | Description |
MessageType |
isBuilt
protected boolean isBuilt
Field Value | |
---|---|
Type | Description |
boolean |
Methods
build()
public final MessageType build()
Returns | |
---|---|
Type | Description |
MessageType |
buildPartial()
public MessageType buildPartial()
Returns | |
---|---|
Type | Description |
MessageType |
clear()
public final BuilderType clear()
Returns | |
---|---|
Type | Description |
BuilderType |
clone()
public BuilderType clone()
Clones the Builder.
Returns | |
---|---|
Type | Description |
BuilderType |
copyOnWrite()
protected final void copyOnWrite()
Called before any method that would mutate the builder to ensure that it correctly copies any state before the write happens to preserve immutability guarantees.
copyOnWriteInternal()
protected void copyOnWriteInternal()
getDefaultInstanceForType()
public MessageType getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
MessageType |
internalMergeFrom(MessageType message)
protected BuilderType internalMergeFrom(MessageType message)
Parameter | |
---|---|
Name | Description |
message | MessageType |
Returns | |
---|---|
Type | Description |
BuilderType |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(MessageType message)
public BuilderType mergeFrom(MessageType message)
All subclasses implement this.
Parameter | |
---|---|
Name | Description |
message | MessageType |
Returns | |
---|---|
Type | Description |
BuilderType |
mergeFrom(byte[] input, int offset, int length)
public BuilderType mergeFrom(byte[] input, int offset, int length)
Parse data
as a message of this type and merge it with the message being built. This
is just a small wrapper around #mergeFrom(CodedInputStream).
Parameters | |
---|---|
Name | Description |
input | byte[] |
offset | int |
length | int |
Returns | |
---|---|
Type | Description |
BuilderType |
Exceptions | |
---|---|
Type | Description |
InvalidProtocolBufferException |
mergeFrom(byte[] input, int offset, int length, ExtensionRegistryLite extensionRegistry)
public BuilderType mergeFrom(byte[] input, int offset, int length, ExtensionRegistryLite extensionRegistry)
Parse data
as a message of this type and merge it with the message being built. This
is just a small wrapper around #mergeFrom(CodedInputStream,ExtensionRegistryLite).
Parameters | |
---|---|
Name | Description |
input | byte[] |
offset | int |
length | int |
extensionRegistry | ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
BuilderType |
Exceptions | |
---|---|
Type | Description |
InvalidProtocolBufferException |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public BuilderType mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Like Builder#mergeFrom(CodedInputStream), but also parses extensions. The extensions
that you want to be able to parse must be registered in extensionRegistry
. Extensions
not in the registry will be treated as unknown fields.
Parameters | |
---|---|
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
BuilderType |
Exceptions | |
---|---|
Type | Description |
IOException |