Package dev.enola.common.protobuf
Class TypeRegistryWrapper
java.lang.Object
dev.enola.common.protobuf.TypeRegistryWrapper
- All Implemented Interfaces:
DescriptorProvider
TypeRegistryWrapper is a registry of ProtoBuf type descriptors.
While it's similar to ProtoBuf's own TypeRegistry, this one (a) has a names()
method to enumerate all registered types' names, and (b) includes not just "message" but also
"enum" and "service".
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.DescriptorProtos.FileDescriptorSetcom.google.protobuf.Descriptors.GenericDescriptorfindByName(String name) static TypeRegistryWrapperfrom(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet) com.google.protobuf.TypeRegistryget()com.google.protobuf.Descriptors.DescriptorgetDescriptorForTypeUrl(String typeURL) names()static TypeRegistryWrapper.Builder
-
Method Details
-
newBuilder
-
from
public static TypeRegistryWrapper from(com.google.protobuf.DescriptorProtos.FileDescriptorSet fileDescriptorSet) throws com.google.protobuf.Descriptors.DescriptorValidationException - Throws:
com.google.protobuf.Descriptors.DescriptorValidationException
-
get
-
fileDescriptorSet
-
names
-
findByName
- Specified by:
findByNamein interfaceDescriptorProvider
-
getDescriptorForTypeUrl
- Specified by:
getDescriptorForTypeUrlin interfaceDescriptorProvider
-