Class Protobuf

java.lang.Object
com.google.protobuf.Protobuf

@ExperimentalApi @CheckReturnValue final class Protobuf extends Object
  • Field Details

  • Constructor Details

    • Protobuf

      private Protobuf()
  • Method Details

    • getInstance

      static Protobuf getInstance()
      Gets the singleton instance of the Protobuf runtime.
    • writeTo

      <T> void writeTo(T message, Writer writer) throws IOException
      Writes the given message to the target Writer.
      Throws:
      IOException
    • mergeFrom

      <T> void mergeFrom(T message, Reader reader, ExtensionRegistryLite extensionRegistry) throws IOException
      Reads fields from the given Reader and merges them into the message.
      Throws:
      IOException
    • isInitialized

      <T> boolean isInitialized(T message)
      Checks if all required fields are set.
    • schemaFor

      <T> Schema<T> schemaFor(Class<T> messageType)
      Gets the schema for the given message type.
    • schemaFor

      <T> Schema<T> schemaFor(T message)
      Gets the schema for the given message.