Package com.google.protobuf
Class Protobuf
- java.lang.Object
-
- com.google.protobuf.Protobuf
-
@ExperimentalApi @CheckReturnValue final class Protobuf extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static ProtobufINSTANCEprivate java.util.concurrent.ConcurrentMap<java.lang.Class<?>,Schema<?>>schemaCacheprivate SchemaFactoryschemaFactory
-
Constructor Summary
Constructors Modifier Constructor Description privateProtobuf()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static ProtobufgetInstance()Gets the singleton instance of the Protobuf runtime.(package private) <T> booleanisInitialized(T message)Checks if all required fields are set.(package private) <T> voidmergeFrom(T message, Reader reader, ExtensionRegistryLite extensionRegistry)Reads fields from the givenReaderand 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> voidwriteTo(T message, Writer writer)Writes the given message to the targetWriter.
-
-
-
Field Detail
-
INSTANCE
private static final Protobuf INSTANCE
-
schemaFactory
private final SchemaFactory schemaFactory
-
schemaCache
private final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,Schema<?>> schemaCache
-
-
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.IOExceptionWrites the given message to the targetWriter.- Throws:
java.io.IOException
-
mergeFrom
<T> void mergeFrom(T message, Reader reader, ExtensionRegistryLite extensionRegistry) throws java.io.IOExceptionReads fields from the givenReaderand 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.
-
-