Class StructuralMessageInfo

java.lang.Object
com.google.protobuf.StructuralMessageInfo
All Implemented Interfaces:
MessageInfo

@ExperimentalApi final class StructuralMessageInfo extends Object implements MessageInfo
Information for the layout of a protobuf message class. This describes all of the fields contained within a message.
  • Field Details

    • 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 Details

    • StructuralMessageInfo

      StructuralMessageInfo(ProtoSyntax syntax, boolean messageSetWireFormat, int[] checkInitialized, FieldInfo[] fields, Object defaultInstance)
      Constructor.
      Parameters:
      checkInitialized - fields to check in isInitialized().
      fields - the set of fields for the message, in field number order.
  • Method Details

    • getSyntax

      public ProtoSyntax getSyntax()
      Gets the syntax for the message (e.g. PROTO2, PROTO3).
      Specified by:
      getSyntax in interface MessageInfo
    • isMessageSetWireFormat

      public boolean isMessageSetWireFormat()
      Indicates whether or not the message should be represented with message set wire format.
      Specified by:
      isMessageSetWireFormat in interface MessageInfo
    • 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 interface MessageInfo
    • newBuilder

      public static StructuralMessageInfo.Builder newBuilder()
      Helper method for creating a new builder for MessageInfo.
    • newBuilder

      public static StructuralMessageInfo.Builder newBuilder(int numFields)
      Helper method for creating a new builder for MessageInfo.