Class GeneratedMessageLite.Builder<MessageType,BuilderType> (3.19.4)
public abstract static class GeneratedMessageLite.Builder<MessageType,BuilderType> extends AbstractMessageLite.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()
| Returns |
| Type |
Description |
BuilderType |
|
Overrides
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 |
|
Overrides
isInitialized()
public final boolean isInitialized()
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 |
|
Overrides
mergeFrom(byte[] input, int offset, int length, ExtensionRegistryLite extensionRegistry)
public BuilderType mergeFrom(byte[] input, int offset, int length, ExtensionRegistryLite extensionRegistry)
| Returns |
| Type |
Description |
BuilderType |
|
Overrides
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.
| Returns |
| Type |
Description |
BuilderType |
|
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.
[[["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-10-30 UTC."],[],[]]