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 class
StructuralMessageInfo.Builder
A builder ofMessageInfo
instances.
-
Field Summary
Fields Modifier and Type Field Description private int[]
checkInitialized
private MessageLite
defaultInstance
private FieldInfo[]
fields
private boolean
messageSetWireFormat
private ProtoSyntax
syntax
-
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().MessageLite
getDefaultInstance()
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.ProtoSyntax
getSyntax()
Gets the syntax for the message (e.g.boolean
isMessageSetWireFormat()
Indicates whether or not the message should be represented with message set wire format.static StructuralMessageInfo.Builder
newBuilder()
Helper method for creating a new builder forMessageInfo
.static StructuralMessageInfo.Builder
newBuilder(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:
getSyntax
in interfaceMessageInfo
-
isMessageSetWireFormat
public boolean isMessageSetWireFormat()
Indicates whether or not the message should be represented with message set wire format.- Specified by:
isMessageSetWireFormat
in 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:MessageInfo
Gets the default instance of this type.- Specified by:
getDefaultInstance
in 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
.
-
-