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 ManifestSchemaFactoryschemaFactory
-
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 extends GeneratedMessageLite<?,?>>
booleanisInitialized(T message)Checks if all required fields are set.(package private) <T extends GeneratedMessageLite<?,?>>
voidmergeFrom(T message, CodedInputStreamReader reader, ExtensionRegistryLite extensionRegistry)Reads fields from the givenCodedInputStreamReaderand merges them into the message.private <T extends GeneratedMessageLite<?,?>>
Schema<T>registerSchema(java.lang.Class<T> messageType)(package private) <T extends GeneratedMessageLite<?,?>>
Schema<T>schemaFor(java.lang.Class<T> messageType)Gets the schema for the given message type.(package private) <T extends GeneratedMessageLite<?,?>>
Schema<T>schemaFor(T message)Gets the schema for the given message.(package private) <T extends GeneratedMessageLite<?,?>>
voidwriteTo(T message, CodedOutputStreamWriter writer)Writes the given message to the targetCodedOutputStreamWriter.
-
-
-
Field Detail
-
INSTANCE
private static final Protobuf INSTANCE
-
schemaFactory
private final ManifestSchemaFactory 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 extends GeneratedMessageLite<?,?>> void writeTo(T message, CodedOutputStreamWriter writer) throws java.io.IOException
Writes the given message to the targetCodedOutputStreamWriter.- Throws:
java.io.IOException
-
mergeFrom
<T extends GeneratedMessageLite<?,?>> void mergeFrom(T message, CodedInputStreamReader reader, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
Reads fields from the givenCodedInputStreamReaderand merges them into the message.- Throws:
java.io.IOException
-
isInitialized
<T extends GeneratedMessageLite<?,?>> boolean isInitialized(T message)
Checks if all required fields are set.
-
schemaFor
<T extends GeneratedMessageLite<?,?>> Schema<T> schemaFor(java.lang.Class<T> messageType)
Gets the schema for the given message type.
-
registerSchema
private <T extends GeneratedMessageLite<?,?>> Schema<T> registerSchema(java.lang.Class<T> messageType)
-
schemaFor
<T extends GeneratedMessageLite<?,?>> Schema<T> schemaFor(T message)
Gets the schema for the given message.
-
-