public class DynamicSchema extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DynamicSchema.Builder
DynamicSchema.Builder
|
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.Descriptors.EnumDescriptor |
getEnumDescriptor(String enumTypeName)
Gets the protobuf enum descriptor for the given enum type
|
Set<String> |
getEnumTypes()
Returns the enum types registered with the schema
|
com.google.protobuf.Descriptors.EnumValueDescriptor |
getEnumValue(String enumTypeName,
int enumNumber)
Gets the enum value for the given enum type and number
|
com.google.protobuf.Descriptors.EnumValueDescriptor |
getEnumValue(String enumTypeName,
String enumName)
Gets the enum value for the given enum type and name
|
com.google.protobuf.DescriptorProtos.FileDescriptorSet |
getFileDescriptorSet()
Returns the internal file descriptor set of this schema
|
com.google.protobuf.Descriptors.Descriptor |
getMessageDescriptor(String msgTypeName)
Gets the protobuf message descriptor for the given message type
|
Set<String> |
getMessageTypes()
Returns the message types registered with the schema
|
static DynamicSchema.Builder |
newBuilder()
Creates a new dynamic schema builder
|
com.google.protobuf.DynamicMessage.Builder |
newMessageBuilder(String msgTypeName)
Creates a new dynamic message builder for the given message type
|
static DynamicSchema |
parseFrom(byte[] schemaDescBuf)
Parses a serialized schema descriptor (from byte array)
|
static DynamicSchema |
parseFrom(InputStream schemaDescIn)
Parses a serialized schema descriptor (from input stream; closes the stream)
|
byte[] |
toByteArray()
Serializes the schema
|
String |
toString()
Returns a string representation of the schema
|
public static DynamicSchema.Builder newBuilder()
public static DynamicSchema parseFrom(InputStream schemaDescIn) throws com.google.protobuf.Descriptors.DescriptorValidationException, IOException
schemaDescIn - the descriptor input streamcom.google.protobuf.Descriptors.DescriptorValidationExceptionIOExceptionpublic static DynamicSchema parseFrom(byte[] schemaDescBuf) throws com.google.protobuf.Descriptors.DescriptorValidationException, IOException
schemaDescBuf - the descriptor byte arraycom.google.protobuf.Descriptors.DescriptorValidationExceptionIOExceptionpublic com.google.protobuf.DynamicMessage.Builder newMessageBuilder(String msgTypeName)
msgTypeName - the message type namepublic com.google.protobuf.Descriptors.Descriptor getMessageDescriptor(String msgTypeName)
msgTypeName - the message type namepublic com.google.protobuf.Descriptors.EnumValueDescriptor getEnumValue(String enumTypeName, String enumName)
enumTypeName - the enum type nameenumName - the enum namepublic com.google.protobuf.Descriptors.EnumValueDescriptor getEnumValue(String enumTypeName, int enumNumber)
enumTypeName - the enum type nameenumNumber - the enum numberpublic com.google.protobuf.Descriptors.EnumDescriptor getEnumDescriptor(String enumTypeName)
enumTypeName - the enum type namepublic Set<String> getMessageTypes()
public Set<String> getEnumTypes()
public com.google.protobuf.DescriptorProtos.FileDescriptorSet getFileDescriptorSet()
public byte[] toByteArray()
Copyright © 2020. All rights reserved.