public abstract static class GeneratedMessageLite.Builder<MessageType extends GeneratedMessageLite<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>> extends AbstractMessageLite.Builder<BuilderType>
Modifier and Type | Field and Description |
---|---|
protected MessageType |
instance |
protected boolean |
isBuilt |
Modifier | Constructor and Description |
---|---|
protected |
GeneratedMessageLite.Builder(MessageType defaultInstance) |
Modifier and Type | Method and Description |
---|---|
MessageType |
build()
Constructs the message based on the state of the Builder.
|
MessageType |
buildPartial()
Like
MessageLite.Builder.build() , but does not throw an exception if the message
is missing required fields. |
BuilderType |
clear()
Resets all fields to their default values.
|
BuilderType |
clone()
Clones the Builder.
|
protected 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.
|
MessageType |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded
messages are set, false otherwise.
|
BuilderType |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry)
Like
MessageLite.Builder.mergeFrom(CodedInputStream) , but also
parses extensions. |
BuilderType |
mergeFrom(MessageType message)
All subclasses implement this.
|
addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException
protected MessageType extends GeneratedMessageLite<MessageType,BuilderType> instance
protected boolean isBuilt
protected GeneratedMessageLite.Builder(MessageType defaultInstance)
protected void copyOnWrite()
public final boolean isInitialized()
MessageLiteOrBuilder
public final BuilderType clear()
MessageLite.Builder
public BuilderType clone()
MessageLite.Builder
clone
in interface MessageLite.Builder
clone
in class AbstractMessageLite.Builder<BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>
Object.clone()
public MessageType buildPartial()
MessageLite.Builder
MessageLite.Builder.build()
, but does not throw an exception if the message
is missing required fields. Instead, a partial message is returned.
Subsequent changes to the Builder will not affect the returned message.public final MessageType build()
MessageLite.Builder
public BuilderType mergeFrom(MessageType message)
public MessageType getDefaultInstanceForType()
MessageLiteOrBuilder
getDefaultInstance()
method of generated message classes in that
this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific
class. They return the same thing.public BuilderType mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
MessageLite.Builder
MessageLite.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.mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessageLite.Builder<BuilderType extends GeneratedMessageLite.Builder<MessageType,BuilderType>>
java.io.IOException