use of com.squareup.wire.schema.internal.parser.OptionElement.Kind in project schema2proto by entur.
the class ProtoSerializer method addConfigurationSpecifiedOptions.
private void addConfigurationSpecifiedOptions(Map<String, ProtoFile> packageToProtoFileMap) {
for (Entry<String, ProtoFile> protoFile : packageToProtoFileMap.entrySet()) {
for (Entry<String, Object> option : configuration.options.entrySet()) {
Kind kind = null;
if (option.getValue() instanceof Boolean) {
kind = Kind.BOOLEAN;
} else if (option.getValue() instanceof Number) {
kind = Kind.NUMBER;
} else {
kind = Kind.STRING;
}
OptionElement optionElement = new OptionElement(option.getKey(), kind, option.getValue(), false);
protoFile.getValue().options().add(optionElement);
}
}
}
Aggregations