public abstract class MicroEJMessageLite extends Object
Replaces GeneratedMessageLite for environments without java.lang.reflect. Generated message classes
extend this and provide inline writeTo, mergeFrom, and getSerializedSize implementations — no
schema engine or reflection needed.
Supports proto2 extensions via FieldSet and ExtensionRegistryLite.
| Modifier and Type | Class and Description |
|---|---|
protected class |
MicroEJMessageLite.ExtensionWriter
Used by subclasses to serialize extensions.
|
| Modifier and Type | Field and Description |
|---|---|
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> |
extensions
Extension fields for extensible messages.
|
protected int |
memoizedSerializedSize |
protected UnknownFieldSetLite |
unknownFields |
| Constructor and Description |
|---|
MicroEJMessageLite() |
| Modifier and Type | Method and Description |
|---|---|
<Type> void |
addRepeatedExtension(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension,
Type value)
Add a repeated extension value.
|
void |
clearExtension(GeneratedMessageLite.GeneratedExtension<?,?> extension)
Clear an extension.
|
void |
copyExtensionsFrom(MicroEJMessageLite other)
Copy all extensions from another message.
|
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> |
ensureExtensionsAreMutable()
Ensure the extension FieldSet is mutable.
|
protected boolean |
extensionsAreEmpty()
Check if extensions are empty.
|
protected boolean |
extensionsAreEqual(MicroEJMessageLite other)
Compare extensions with another message.
|
protected int |
extensionsHashCode()
Hash code of extensions.
|
protected void |
extensionsMakeImmutable()
Make extensions immutable.
|
protected int |
extensionsSerializedSize()
Returns the serialized size of all extension fields.
|
abstract MicroEJMessageLite |
getDefaultInstanceForType()
Returns a new default (empty) instance of this message type.
|
<Type> Type |
getExtension(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension,
int index)
Get one element of a repeated extension.
|
<Type> Type |
getExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
Get the value of an extension.
|
<Type> int |
getExtensionCount(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension)
Get the number of elements in a repeated extension.
|
abstract int |
getSerializedSize()
Returns the number of bytes required to serialize this message.
|
UnknownFieldSetLite |
getUnknownFields()
Returns the unknown fields stored during parsing.
|
<Type> boolean |
hasExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
Check if a singular extension is present.
|
boolean |
isInitialized()
Returns true if all required fields are set (always true for proto3).
|
protected void |
mergeExtensionFields(MicroEJMessageLite other)
Merge extension fields from another message.
|
protected MicroEJMessageLite |
microejMerge(MicroEJMessageLite other)
Create a new message by merging this message with another of the same type.
|
protected MicroEJMessageLite |
microejParseFrom(CodedInputStream input)
Parse a new instance of this message type from a stream.
|
protected MicroEJMessageLite.ExtensionWriter |
newExtensionWriter() |
protected boolean |
parseUnknownField(int tag,
CodedInputStream input)
Parses an unknown field during
mergeFrom and stores it for round-trip preservation. |
protected boolean |
parseUnknownField(MicroEJMessageLite defaultInstance,
CodedInputStream input,
ExtensionRegistryLite extensionRegistry,
int tag)
Parse an extension or unknown field.
|
<Type> void |
setExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension,
Type value)
Set a singular extension value.
|
byte[] |
toByteArray()
Serializes this message to a byte array.
|
ByteString |
toByteString()
Returns a
ByteString containing the serialized message. |
void |
writeDelimitedTo(OutputStream output)
Serializes this message with a varint length prefix to an
OutputStream. |
abstract void |
writeTo(CodedOutputStream output)
Serializes this message to a
CodedOutputStream. |
void |
writeTo(OutputStream output)
Serializes this message to an
OutputStream. |
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> extensions
protected int memoizedSerializedSize
protected UnknownFieldSetLite unknownFields
public final <Type> void addRepeatedExtension(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension, Type value)
public final void clearExtension(GeneratedMessageLite.GeneratedExtension<?,?> extension)
public void copyExtensionsFrom(MicroEJMessageLite other)
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> ensureExtensionsAreMutable()
protected boolean extensionsAreEmpty()
protected boolean extensionsAreEqual(MicroEJMessageLite other)
protected int extensionsHashCode()
protected void extensionsMakeImmutable()
protected int extensionsSerializedSize()
public abstract MicroEJMessageLite getDefaultInstanceForType()
public final <Type> Type getExtension(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension, int index)
public final <Type> Type getExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
public final <Type> int getExtensionCount(GeneratedMessageLite.GeneratedExtension<?,List<Type>> extension)
public abstract int getSerializedSize()
public final UnknownFieldSetLite getUnknownFields()
public final <Type> boolean hasExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
public boolean isInitialized()
protected void mergeExtensionFields(MicroEJMessageLite other)
protected MicroEJMessageLite microejMerge(MicroEJMessageLite other)
protected MicroEJMessageLite microejParseFrom(CodedInputStream input) throws IOException
IOExceptionprotected MicroEJMessageLite.ExtensionWriter newExtensionWriter()
protected final boolean parseUnknownField(int tag,
CodedInputStream input)
throws IOException
mergeFrom and stores it for round-trip preservation.tag - the field tag that was not recognizedinput - the input stream positioned after the tagIOExceptionprotected boolean parseUnknownField(MicroEJMessageLite defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry, int tag) throws IOException
defaultInstance - the default instance of this message type (for registry lookup)input - the coded input streamextensionRegistry - the extension registrytag - the field tag already readtrue unless the tag is an end-group tagIOExceptionpublic final <Type> void setExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension, Type value)
public final byte[] toByteArray()
public final ByteString toByteString()
ByteString containing the serialized message.public final void writeDelimitedTo(OutputStream output) throws IOException
OutputStream.IOExceptionpublic abstract void writeTo(CodedOutputStream output) throws IOException
CodedOutputStream.IOExceptionpublic final void writeTo(OutputStream output) throws IOException
OutputStream.IOException