use of com.squareup.wire.schema.internal.parser.EnumElement in project aws-glue-schema-registry by awslabs.
the class ProtobufFile method buildIndexes.
private void buildIndexes() {
for (TypeElement typeElement : element.getTypes()) {
if (typeElement instanceof MessageElement) {
MessageElement messageElement = (MessageElement) typeElement;
processMessageElement("", messageElement);
} else if (typeElement instanceof EnumElement) {
EnumElement enumElement = (EnumElement) typeElement;
processEnumElement("", enumElement);
} else {
throw new RuntimeException();
}
}
for (ServiceElement serviceElement : element.getServices()) {
Set<String> rpcNames = new HashSet<>();
Map<String, String> rpcSignatures = new HashMap<>();
for (RpcElement rpcElement : serviceElement.getRpcs()) {
rpcNames.add(rpcElement.getName());
String signature = rpcElement.getRequestType() + ":" + rpcElement.getRequestStreaming() + "->" + rpcElement.getResponseType() + ":" + rpcElement.getResponseStreaming();
rpcSignatures.put(rpcElement.getName(), signature);
}
if (!rpcNames.isEmpty()) {
serviceRPCnames.put(serviceElement.getName(), rpcNames);
serviceRPCSignatures.put(serviceElement.getName(), rpcSignatures);
}
}
}
Aggregations