Class GeneratedMessageLite.Builder<MessageType,BuilderType> (3.19.4)

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

NameDescription
MessageType
BuilderType

Constructors

Builder(MessageType defaultInstance)

protected Builder(MessageType defaultInstance)
Parameter
NameDescription
defaultInstanceMessageType

Fields

instance

protected MessageType instance
Field Value
TypeDescription
MessageType

isBuilt

protected boolean isBuilt
Field Value
TypeDescription
boolean

Methods

build()

public final MessageType build()
Returns
TypeDescription
MessageType

buildPartial()

public MessageType buildPartial()
Returns
TypeDescription
MessageType

clear()

public final BuilderType clear()
Returns
TypeDescription
BuilderType

clone()

public BuilderType clone()

Clones the Builder.

Returns
TypeDescription
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
TypeDescription
MessageType

internalMergeFrom(MessageType message)

protected BuilderType internalMergeFrom(MessageType message)
Parameter
NameDescription
messageMessageType
Returns
TypeDescription
BuilderType
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean

mergeFrom(MessageType message)

public BuilderType mergeFrom(MessageType message)

All subclasses implement this.

Parameter
NameDescription
messageMessageType
Returns
TypeDescription
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
NameDescription
inputbyte[]
offsetint
lengthint
Returns
TypeDescription
BuilderType
Overrides
Exceptions
TypeDescription
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
NameDescription
inputbyte[]
offsetint
lengthint
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuilderType
Overrides
Exceptions
TypeDescription
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
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuilderType
Overrides
Exceptions
TypeDescription
IOException