Package com.google.protobuf
Class StructuralMessageInfo
- java.lang.Object
-
- com.google.protobuf.StructuralMessageInfo
-
- All Implemented Interfaces:
MessageInfo
@ExperimentalApi @CheckReturnValue final class StructuralMessageInfo extends java.lang.Object implements MessageInfo
Information for the layout of a protobuf message class. This describes all of the fields contained within a message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStructuralMessageInfo.BuilderA builder ofMessageInfoinstances.
-
Field Summary
Fields Modifier and Type Field Description private int[]checkInitializedprivate MessageLitedefaultInstanceprivate FieldInfo[]fieldsprivate booleanmessageSetWireFormatprivate ProtoSyntaxsyntax
-
Constructor Summary
Constructors Constructor Description StructuralMessageInfo(ProtoSyntax syntax, boolean messageSetWireFormat, int[] checkInitialized, FieldInfo[] fields, java.lang.Object defaultInstance)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]getCheckInitialized()An array of field numbers that need to be checked for isInitialized().MessageLitegetDefaultInstance()Gets the default instance of this type.FieldInfo[]getFields()Gets the information for all fields within this message, sorted in ascending order by their field number.ProtoSyntaxgetSyntax()Gets the syntax for the message (e.g.booleanisMessageSetWireFormat()Indicates whether or not the message should be represented with message set wire format.static StructuralMessageInfo.BuildernewBuilder()Helper method for creating a new builder forMessageInfo.static StructuralMessageInfo.BuildernewBuilder(int numFields)Helper method for creating a new builder forMessageInfo.
-
-
-
Field Detail
-
syntax
private final ProtoSyntax syntax
-
messageSetWireFormat
private final boolean messageSetWireFormat
-
checkInitialized
private final int[] checkInitialized
-
fields
private final FieldInfo[] fields
-
defaultInstance
private final MessageLite defaultInstance
-
-
Constructor Detail
-
StructuralMessageInfo
StructuralMessageInfo(ProtoSyntax syntax, boolean messageSetWireFormat, int[] checkInitialized, FieldInfo[] fields, java.lang.Object defaultInstance)
Constructor.- Parameters:
checkInitialized- fields to check in isInitialized().fields- the set of fields for the message, in field number order.
-
-
Method Detail
-
getSyntax
public ProtoSyntax getSyntax()
Gets the syntax for the message (e.g. PROTO2, PROTO3).- Specified by:
getSyntaxin interfaceMessageInfo
-
isMessageSetWireFormat
public boolean isMessageSetWireFormat()
Indicates whether or not the message should be represented with message set wire format.- Specified by:
isMessageSetWireFormatin interfaceMessageInfo
-
getCheckInitialized
public int[] getCheckInitialized()
An array of field numbers that need to be checked for isInitialized().
-
getFields
public FieldInfo[] getFields()
Gets the information for all fields within this message, sorted in ascending order by their field number.
-
getDefaultInstance
public MessageLite getDefaultInstance()
Description copied from interface:MessageInfoGets the default instance of this type.- Specified by:
getDefaultInstancein interfaceMessageInfo
-
newBuilder
public static StructuralMessageInfo.Builder newBuilder()
Helper method for creating a new builder forMessageInfo.
-
newBuilder
public static StructuralMessageInfo.Builder newBuilder(int numFields)
Helper method for creating a new builder forMessageInfo.
-
-