Package com.google.protobuf
Class MicroEJMessageLite
- java.lang.Object
-
- com.google.protobuf.MicroEJMessageLite
-
public abstract class MicroEJMessageLite extends java.lang.ObjectBase class for MicroEJ-generated protobuf messages.Replaces
GeneratedMessageLitefor environments withoutjava.lang.reflect. Generated message classes extend this and provide inlinewriteTo,mergeFrom, andgetSerializedSizeimplementations — no schema engine or reflection needed.Supports proto2 extensions via
FieldSetandExtensionRegistryLite.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classMicroEJMessageLite.ExtensionWriterUsed by subclasses to serialize extensions.
-
Field Summary
Fields Modifier and Type Field Description protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor>extensionsExtension fields for extensible messages.protected intmemoizedSerializedSizeprotected UnknownFieldSetLiteunknownFields
-
Constructor Summary
Constructors Constructor Description MicroEJMessageLite()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <Type> voidaddRepeatedExtension(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension, Type value)Add a repeated extension value.voidclearExtension(GeneratedMessageLite.GeneratedExtension<?,?> extension)Clear an extension.voidcopyExtensionsFrom(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 booleanextensionsAreEmpty()Check if extensions are empty.protected booleanextensionsAreEqual(MicroEJMessageLite other)Compare extensions with another message.protected intextensionsHashCode()Hash code of extensions.protected voidextensionsMakeImmutable()Make extensions immutable.protected intextensionsSerializedSize()Returns the serialized size of all extension fields.abstract MicroEJMessageLitegetDefaultInstanceForType()Returns a new default (empty) instance of this message type.<Type> TypegetExtension(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension, int index)Get one element of a repeated extension.<Type> TypegetExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)Get the value of an extension.<Type> intgetExtensionCount(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension)Get the number of elements in a repeated extension.abstract intgetSerializedSize()Returns the number of bytes required to serialize this message.UnknownFieldSetLitegetUnknownFields()Returns the unknown fields stored during parsing.<Type> booleanhasExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)Check if a singular extension is present.booleanisInitialized()Returns true if all required fields are set (always true for proto3).protected voidmergeExtensionFields(MicroEJMessageLite other)Merge extension fields from another message.protected MicroEJMessageLitemicroejMerge(MicroEJMessageLite other)Create a new message by merging this message with another of the same type.protected MicroEJMessageLitemicroejParseFrom(CodedInputStream input)Parse a new instance of this message type from a stream.protected MicroEJMessageLite.ExtensionWriternewExtensionWriter()protected booleanparseUnknownField(int tag, CodedInputStream input)Parses an unknown field duringmergeFromand stores it for round-trip preservation.protected booleanparseUnknownField(MicroEJMessageLite defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry, int tag)Parse an extension or unknown field.<Type> voidsetExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension, Type value)Set a singular extension value.byte[]toByteArray()Serializes this message to a byte array.ByteStringtoByteString()Returns aByteStringcontaining the serialized message.voidwriteDelimitedTo(java.io.OutputStream output)Serializes this message with a varint length prefix to anOutputStream.abstract voidwriteTo(CodedOutputStream output)Serializes this message to aCodedOutputStream.voidwriteTo(java.io.OutputStream output)Serializes this message to anOutputStream.
-
-
-
Field Detail
-
unknownFields
protected UnknownFieldSetLite unknownFields
-
memoizedSerializedSize
protected int memoizedSerializedSize
-
extensions
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> extensions
Extension fields for extensible messages.
-
-
Method Detail
-
writeTo
public abstract void writeTo(CodedOutputStream output) throws java.io.IOException
Serializes this message to aCodedOutputStream.- Throws:
java.io.IOException
-
getSerializedSize
public abstract int getSerializedSize()
Returns the number of bytes required to serialize this message.
-
getDefaultInstanceForType
public abstract MicroEJMessageLite getDefaultInstanceForType()
Returns a new default (empty) instance of this message type.
-
isInitialized
public boolean isInitialized()
Returns true if all required fields are set (always true for proto3).
-
toByteArray
public final byte[] toByteArray()
Serializes this message to a byte array.
-
writeTo
public final void writeTo(java.io.OutputStream output) throws java.io.IOExceptionSerializes this message to anOutputStream.- Throws:
java.io.IOException
-
writeDelimitedTo
public final void writeDelimitedTo(java.io.OutputStream output) throws java.io.IOExceptionSerializes this message with a varint length prefix to anOutputStream.- Throws:
java.io.IOException
-
toByteString
public final ByteString toByteString()
Returns aByteStringcontaining the serialized message.
-
parseUnknownField
protected final boolean parseUnknownField(int tag, CodedInputStream input) throws java.io.IOExceptionParses an unknown field duringmergeFromand stores it for round-trip preservation.- Parameters:
tag- the field tag that was not recognizedinput- the input stream positioned after the tag- Returns:
- false if the tag is an end-group marker, true otherwise
- Throws:
java.io.IOException
-
getUnknownFields
public final UnknownFieldSetLite getUnknownFields()
Returns the unknown fields stored during parsing.
-
ensureExtensionsAreMutable
protected com.google.protobuf.FieldSet<com.google.protobuf.GeneratedMessageLite.ExtensionDescriptor> ensureExtensionsAreMutable()
Ensure the extension FieldSet is mutable. For use by generated code.
-
mergeExtensionFields
protected void mergeExtensionFields(MicroEJMessageLite other)
Merge extension fields from another message. Simple copy for singular fields, append for repeated fields. For use by generated builder code.
-
parseUnknownField
protected boolean parseUnknownField(MicroEJMessageLite defaultInstance, CodedInputStream input, ExtensionRegistryLite extensionRegistry, int tag) throws java.io.IOException
Parse an extension or unknown field. For use by generated code only.- Parameters:
defaultInstance- the default instance of this message type (for registry lookup)input- the coded input streamextensionRegistry- the extension registrytag- the field tag already read- Returns:
trueunless the tag is an end-group tag- Throws:
java.io.IOException
-
hasExtension
public final <Type> boolean hasExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
Check if a singular extension is present.
-
getExtension
public final <Type> Type getExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension)
Get the value of an extension.
-
getExtensionCount
public final <Type> int getExtensionCount(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension)
Get the number of elements in a repeated extension.
-
getExtension
public final <Type> Type getExtension(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension, int index)
Get one element of a repeated extension.
-
setExtension
public final <Type> void setExtension(GeneratedMessageLite.GeneratedExtension<?,Type> extension, Type value)
Set a singular extension value. For use by generated Builder code.
-
addRepeatedExtension
public final <Type> void addRepeatedExtension(GeneratedMessageLite.GeneratedExtension<?,java.util.List<Type>> extension, Type value)
Add a repeated extension value. For use by generated Builder code.
-
clearExtension
public final void clearExtension(GeneratedMessageLite.GeneratedExtension<?,?> extension)
Clear an extension. For use by generated Builder code.
-
copyExtensionsFrom
public void copyExtensionsFrom(MicroEJMessageLite other)
Copy all extensions from another message. For use by generated Builder code.
-
extensionsAreEmpty
protected boolean extensionsAreEmpty()
Check if extensions are empty. For use by generated code.
-
extensionsAreEqual
protected boolean extensionsAreEqual(MicroEJMessageLite other)
Compare extensions with another message. For use by generated equals().
-
extensionsHashCode
protected int extensionsHashCode()
Hash code of extensions. For use by generated hashCode().
-
extensionsMakeImmutable
protected void extensionsMakeImmutable()
Make extensions immutable. For use by generated makeImmutable().
-
newExtensionWriter
protected MicroEJMessageLite.ExtensionWriter newExtensionWriter()
-
extensionsSerializedSize
protected int extensionsSerializedSize()
Returns the serialized size of all extension fields.
-
microejParseFrom
protected MicroEJMessageLite microejParseFrom(CodedInputStream input) throws java.io.IOException
Parse a new instance of this message type from a stream. Generated code overrides this for message-type extension support.- Throws:
java.io.IOException
-
microejMerge
protected MicroEJMessageLite microejMerge(MicroEJMessageLite other)
Create a new message by merging this message with another of the same type. Generated code overrides this for message-type extension support.
-
-