Class Protobuf

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Protobuf()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static Protobuf getInstance()
      Gets the singleton instance of the Protobuf runtime.
      (package private) <T> boolean isInitialized​(T message)
      Checks if all required fields are set.
      (package private) <T> void mergeFrom​(T message, Reader reader, ExtensionRegistryLite extensionRegistry)
      Reads fields from the given Reader and merges them into the message.
      (package private) <T> Schema<T> schemaFor​(java.lang.Class<T> messageType)
      Gets the schema for the given message type.
      (package private) <T> Schema<T> schemaFor​(T message)
      Gets the schema for the given message.
      (package private) <T> void writeTo​(T message, Writer writer)
      Writes the given message to the target Writer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        private static final Protobuf INSTANCE
      • schemaCache

        private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,​Schema<?>> schemaCache
    • Constructor Detail

      • Protobuf

        private Protobuf()
    • Method Detail

      • getInstance

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

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

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

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

        <T> Schema<T> schemaFor​(java.lang.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.