use of com.squareup.wire.schema.internal.parser.ReservedElement in project schema-registry by confluentinc.
the class ProtobufSchema method toDynamicEnum.
private static EnumDefinition toDynamicEnum(EnumElement enumElem) {
Map<String, OptionElement> enumOptions = mergeOptions(enumElem.getOptions());
Boolean allowAlias = findOption(ALLOW_ALIAS, enumOptions).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
Boolean isDeprecated = findOption(DEPRECATED, enumOptions).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
EnumDefinition.Builder enumer = EnumDefinition.newBuilder(enumElem.getName(), allowAlias, isDeprecated);
for (ReservedElement reserved : enumElem.getReserveds()) {
for (Object elem : reserved.getValues()) {
if (elem instanceof String) {
enumer.addReservedName((String) elem);
} else if (elem instanceof Integer) {
int tag = (Integer) elem;
enumer.addReservedRange(tag, tag + 1);
} else if (elem instanceof IntRange) {
IntRange range = (IntRange) elem;
enumer.addReservedRange(range.getStart(), range.getEndInclusive() + 1);
} else {
throw new IllegalStateException("Unsupported reserved type: " + elem.getClass().getName());
}
}
}
for (EnumConstantElement constant : enumElem.getConstants()) {
Map<String, OptionElement> constantOptions = mergeOptions(constant.getOptions());
Boolean isConstDeprecated = findOption(DEPRECATED, constantOptions).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
Optional<OptionElement> meta = findOption(CONFLUENT_ENUM_VALUE_META, constantOptions);
String doc = findDoc(meta);
Map<String, String> params = findParams(meta);
enumer.addValue(constant.getName(), constant.getTag(), doc, params, isConstDeprecated);
}
Optional<OptionElement> meta = findOption(CONFLUENT_ENUM_META, enumOptions);
String doc = findDoc(meta);
Map<String, String> params = findParams(meta);
enumer.setMeta(doc, params);
return enumer.build();
}
use of com.squareup.wire.schema.internal.parser.ReservedElement in project apicurio-registry by Apicurio.
the class FileDescriptorUtils method messageElementToDescriptorProto.
private static DescriptorProto messageElementToDescriptorProto(MessageType messageElem, Schema schema, ProtoFile element) {
ProtobufMessage message = new ProtobufMessage();
message.protoBuilder().setName(messageElem.getType().getSimpleName());
Comparator<Location> locationComparator = Comparator.comparing(Location::getLine).thenComparing(Location::getColumn);
Map<Location, DescriptorProto> allNestedTypes = new TreeMap<>(locationComparator);
List<FieldDescriptorProto> allFields = new ArrayList<>();
for (Type type : messageElem.getNestedTypes()) {
if (type instanceof MessageType) {
allNestedTypes.put(type.getLocation(), messageElementToDescriptorProto((MessageType) type, schema, element));
} else if (type instanceof EnumType) {
message.protoBuilder().addEnumType(enumElementToProto((EnumType) type));
}
}
final Predicate<Field> isProto3Optional = field -> Field.Label.OPTIONAL.equals(field.getLabel()) && Syntax.PROTO_3.equals(element.getSyntax());
final List<OneOf> oneOfs = messageElem.getOneOfs();
final List<OneOf> proto3OptionalOneOfs = messageElem.getFieldsAndOneOfFields().stream().filter(isProto3Optional).map(FileDescriptorUtils::getProto3OptionalField).collect(Collectors.toList());
// Proto3 Optionals are considered as "synthetic-oneofs" by Protobuf compiler.
oneOfs.addAll(proto3OptionalOneOfs);
final Function<String, Optional<OneOf>> findOneOfByFieldName = fieldName -> {
for (OneOf oneOf : oneOfs) {
if (oneOf.getFields().stream().map(Field::getName).anyMatch(f -> f.equals(fieldName))) {
return Optional.of(oneOf);
}
}
return Optional.empty();
};
// Add all the declared fields first skipping oneOfs.
for (final Field field : messageElem.getDeclaredFields()) {
final Optional<OneOf> optionalOneOf = findOneOfByFieldName.apply(field.getName());
if (!optionalOneOf.isPresent()) {
Field.Label fieldLabel = field.getLabel();
// Fields are optional by default in Proto3.
String label = fieldLabel != null ? fieldLabel.toString().toLowerCase() : OPTIONAL;
String fieldType = determineFieldType(field.getType(), schema);
ProtoType protoType = field.getType();
String fieldTypeName = String.valueOf(protoType);
ProtoType keyType = protoType.getKeyType();
ProtoType valueType = protoType.getValueType();
// Map fields are only permitted in messages
if (protoType.isMap() && keyType != null && valueType != null) {
label = "repeated";
fieldType = "message";
String fieldMapEntryName = toMapEntry(field.getName());
// Map entry field name is capitalized
fieldMapEntryName = fieldMapEntryName.substring(0, 1).toUpperCase() + fieldMapEntryName.substring(1);
// Map field type name is resolved with reference to the package
fieldTypeName = String.format("%s.%s", messageElem.getType(), fieldMapEntryName);
ProtobufMessage protobufMapMessage = new ProtobufMessage();
DescriptorProto.Builder mapMessage = protobufMapMessage.protoBuilder().setName(fieldMapEntryName).mergeOptions(DescriptorProtos.MessageOptions.newBuilder().setMapEntry(true).build());
protobufMapMessage.addField(OPTIONAL, determineFieldType(keyType, schema), String.valueOf(keyType), KEY_FIELD, 1, null, null, null, null, null, null, null, null, null, null);
protobufMapMessage.addField(OPTIONAL, determineFieldType(valueType, schema), String.valueOf(valueType), VALUE_FIELD, 2, null, null, null, null, null, null, null, null, null, null);
allNestedTypes.put(field.getLocation(), mapMessage.build());
}
String jsonName = getDefaultJsonName(field.getName()).equals(field.getDeclaredJsonName()) ? null : field.getDeclaredJsonName();
Boolean isDeprecated = findOptionBoolean(DEPRECATED_OPTION, field.getOptions());
Boolean isPacked = findOptionBoolean(PACKED_OPTION, field.getOptions());
DescriptorProtos.FieldOptions.CType cType = findOption(CTYPE_OPTION, field.getOptions()).map(o -> DescriptorProtos.FieldOptions.CType.valueOf(o.getValue().toString())).orElse(null);
DescriptorProtos.FieldOptions.JSType jsType = findOption(JSTYPE_OPTION, field.getOptions()).map(o -> DescriptorProtos.FieldOptions.JSType.valueOf(o.getValue().toString())).orElse(null);
String metadataKey = findOptionString(ProtobufSchemaMetadata.metadataKey.getDescriptor().getFullName(), field.getOptions());
String metadataValue = findOptionString(ProtobufSchemaMetadata.metadataValue.getDescriptor().getFullName(), field.getOptions());
allFields.add(ProtobufMessage.buildFieldDescriptorProto(label, fieldType, fieldTypeName, field.getName(), field.getTag(), field.getDefault(), jsonName, isDeprecated, isPacked, cType, jsType, metadataKey, metadataValue, null, null));
}
}
final Set<OneOf> addedOneOfs = new LinkedHashSet<>();
// Add the oneOfs next including Proto3 Optionals.
for (final OneOf oneOf : oneOfs) {
if (addedOneOfs.contains(oneOf)) {
continue;
}
Boolean isProto3OptionalField = null;
if (proto3OptionalOneOfs.contains(oneOf)) {
isProto3OptionalField = true;
}
OneofDescriptorProto.Builder oneofBuilder = OneofDescriptorProto.newBuilder().setName(oneOf.getName());
message.protoBuilder().addOneofDecl(oneofBuilder);
for (Field oneOfField : oneOf.getFields()) {
String oneOfJsonName = getDefaultJsonName(oneOfField.getName()).equals(oneOfField.getDeclaredJsonName()) ? null : oneOfField.getDeclaredJsonName();
Boolean oneOfIsDeprecated = findOptionBoolean(DEPRECATED_OPTION, oneOfField.getOptions());
Boolean oneOfIsPacked = findOptionBoolean(PACKED_OPTION, oneOfField.getOptions());
DescriptorProtos.FieldOptions.CType oneOfCType = findOption(CTYPE_OPTION, oneOfField.getOptions()).map(o -> DescriptorProtos.FieldOptions.CType.valueOf(o.getValue().toString())).orElse(null);
DescriptorProtos.FieldOptions.JSType oneOfJsType = findOption(JSTYPE_OPTION, oneOfField.getOptions()).map(o -> DescriptorProtos.FieldOptions.JSType.valueOf(o.getValue().toString())).orElse(null);
String metadataKey = findOptionString(ProtobufSchemaMetadata.metadataKey.getDescriptor().getFullName(), oneOfField.getOptions());
String metadataValue = findOptionString(ProtobufSchemaMetadata.metadataValue.getDescriptor().getFullName(), oneOfField.getOptions());
allFields.add(ProtobufMessage.buildFieldDescriptorProto(OPTIONAL, determineFieldType(oneOfField.getType(), schema), String.valueOf(oneOfField.getType()), oneOfField.getName(), oneOfField.getTag(), oneOfField.getDefault(), oneOfJsonName, oneOfIsDeprecated, oneOfIsPacked, oneOfCType, oneOfJsType, metadataKey, metadataValue, message.protoBuilder().getOneofDeclCount() - 1, isProto3OptionalField));
}
addedOneOfs.add(oneOf);
}
for (ReservedElement reserved : messageElem.toElement().getReserveds()) {
for (Object elem : reserved.getValues()) {
if (elem instanceof String) {
message.protoBuilder().addReservedName((String) elem);
} else if (elem instanceof Integer) {
int tag = (Integer) elem;
DescriptorProto.ReservedRange.Builder rangeBuilder = DescriptorProto.ReservedRange.newBuilder().setStart(tag).setEnd(tag + 1);
message.protoBuilder().addReservedRange(rangeBuilder.build());
} else if (elem instanceof IntRange) {
IntRange range = (IntRange) elem;
DescriptorProto.ReservedRange.Builder rangeBuilder = DescriptorProto.ReservedRange.newBuilder().setStart(range.getStart()).setEnd(range.getEndInclusive() + 1);
message.protoBuilder().addReservedRange(rangeBuilder.build());
} else {
throw new IllegalStateException("Unsupported reserved type: " + elem.getClass().getName());
}
}
}
for (ExtensionsElement extensions : messageElem.toElement().getExtensions()) {
for (Object elem : extensions.getValues()) {
if (elem instanceof Integer) {
int tag = (Integer) elem;
DescriptorProto.ExtensionRange.Builder extensionBuilder = DescriptorProto.ExtensionRange.newBuilder().setStart(tag).setEnd(tag + 1);
message.protoBuilder().addExtensionRange(extensionBuilder.build());
} else if (elem instanceof IntRange) {
IntRange range = (IntRange) elem;
DescriptorProto.ExtensionRange.Builder extensionBuilder = DescriptorProto.ExtensionRange.newBuilder().setStart(range.getStart()).setEnd(range.getEndInclusive() + 1);
message.protoBuilder().addExtensionRange(extensionBuilder.build());
} else {
throw new IllegalStateException("Unsupported extension type: " + elem.getClass().getName());
}
}
}
Boolean isMapEntry = findOptionBoolean(MAP_ENTRY_OPTION, messageElem.getOptions());
if (isMapEntry != null) {
DescriptorProtos.MessageOptions.Builder optionsBuilder = DescriptorProtos.MessageOptions.newBuilder().setMapEntry(isMapEntry);
message.protoBuilder().mergeOptions(optionsBuilder.build());
}
Boolean noStandardDescriptorAccessor = findOptionBoolean(NO_STANDARD_DESCRIPTOR_OPTION, messageElem.getOptions());
if (noStandardDescriptorAccessor != null) {
DescriptorProtos.MessageOptions.Builder optionsBuilder = DescriptorProtos.MessageOptions.newBuilder().setNoStandardDescriptorAccessor(noStandardDescriptorAccessor);
message.protoBuilder().mergeOptions(optionsBuilder.build());
}
message.protoBuilder().addAllNestedType(allNestedTypes.values());
message.protoBuilder().addAllField(allFields);
return message.build();
}
use of com.squareup.wire.schema.internal.parser.ReservedElement in project apicurio-registry by Apicurio.
the class FileDescriptorUtils method toDynamicMessage.
private static MessageDefinition toDynamicMessage(MessageElement messageElem) {
MessageDefinition.Builder message = MessageDefinition.newBuilder(messageElem.getName());
for (TypeElement type : messageElem.getNestedTypes()) {
if (type instanceof MessageElement) {
message.addMessageDefinition(toDynamicMessage((MessageElement) type));
} else if (type instanceof EnumElement) {
message.addEnumDefinition(toDynamicEnum((EnumElement) type));
}
}
Set<String> added = new HashSet<>();
for (OneOfElement oneof : messageElem.getOneOfs()) {
MessageDefinition.OneofBuilder oneofBuilder = message.addOneof(oneof.getName());
for (FieldElement field : oneof.getFields()) {
String defaultVal = field.getDefaultValue();
String jsonName = findOption("json_name", field.getOptions()).map(o -> o.getValue().toString()).orElse(null);
oneofBuilder.addField(field.getType(), field.getName(), field.getTag(), defaultVal, jsonName);
added.add(field.getName());
}
}
// Process fields after messages so that any newly created map entry messages are at the end
for (FieldElement field : messageElem.getFields()) {
if (added.contains(field.getName())) {
continue;
}
Field.Label fieldLabel = field.getLabel();
String label = fieldLabel != null ? fieldLabel.toString().toLowerCase() : null;
String fieldType = field.getType();
String defaultVal = field.getDefaultValue();
String jsonName = field.getJsonName();
Boolean isPacked = findOption("packed", field.getOptions()).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
ProtoType protoType = ProtoType.get(fieldType);
ProtoType keyType = protoType.getKeyType();
ProtoType valueType = protoType.getValueType();
// Map fields are only permitted in messages
if (protoType.isMap() && keyType != null && valueType != null) {
label = "repeated";
fieldType = toMapEntry(field.getName());
MessageDefinition.Builder mapMessage = MessageDefinition.newBuilder(fieldType);
mapMessage.setMapEntry(true);
mapMessage.addField(null, keyType.getSimpleName(), KEY_FIELD, 1, null);
mapMessage.addField(null, valueType.getSimpleName(), VALUE_FIELD, 2, null);
message.addMessageDefinition(mapMessage.build());
}
message.addField(label, fieldType, field.getName(), field.getTag(), defaultVal, jsonName, isPacked);
}
for (ReservedElement reserved : messageElem.getReserveds()) {
for (Object elem : reserved.getValues()) {
if (elem instanceof String) {
message.addReservedName((String) elem);
} else if (elem instanceof Integer) {
int tag = (Integer) elem;
message.addReservedRange(tag, tag);
} else if (elem instanceof IntRange) {
IntRange range = (IntRange) elem;
message.addReservedRange(range.getStart(), range.getEndInclusive());
} else {
throw new IllegalStateException("Unsupported reserved type: " + elem.getClass().getName());
}
}
}
Boolean isMapEntry = findOption("map_entry", messageElem.getOptions()).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
if (isMapEntry != null) {
message.setMapEntry(isMapEntry);
}
return message.build();
}
use of com.squareup.wire.schema.internal.parser.ReservedElement in project apicurio-registry by Apicurio.
the class FileDescriptorUtils method toMessage.
private static MessageElement toMessage(FileDescriptorProto file, DescriptorProto descriptor) {
String name = descriptor.getName();
ImmutableList.Builder<FieldElement> fields = ImmutableList.builder();
ImmutableList.Builder<TypeElement> nested = ImmutableList.builder();
ImmutableList.Builder<ReservedElement> reserved = ImmutableList.builder();
ImmutableList.Builder<ExtensionsElement> extensions = ImmutableList.builder();
LinkedHashMap<String, ImmutableList.Builder<FieldElement>> oneofsMap = new LinkedHashMap<>();
for (OneofDescriptorProto od : descriptor.getOneofDeclList()) {
oneofsMap.put(od.getName(), ImmutableList.builder());
}
List<Map.Entry<String, ImmutableList.Builder<FieldElement>>> oneofs = new ArrayList<>(oneofsMap.entrySet());
List<FieldElement> proto3OptionalFields = new ArrayList<>();
for (FieldDescriptorProto fd : descriptor.getFieldList()) {
if (fd.hasProto3Optional()) {
proto3OptionalFields.add(toField(file, fd, false));
continue;
}
if (fd.hasOneofIndex()) {
FieldElement field = toField(file, fd, true);
oneofs.get(fd.getOneofIndex()).getValue().add(field);
} else {
FieldElement field = toField(file, fd, false);
fields.add(field);
}
}
fields.addAll(proto3OptionalFields);
for (DescriptorProto nestedDesc : descriptor.getNestedTypeList()) {
MessageElement nestedMessage = toMessage(file, nestedDesc);
nested.add(nestedMessage);
}
for (EnumDescriptorProto nestedDesc : descriptor.getEnumTypeList()) {
EnumElement nestedEnum = toEnum(nestedDesc);
nested.add(nestedEnum);
}
for (String reservedName : descriptor.getReservedNameList()) {
ReservedElement reservedElem = new ReservedElement(DEFAULT_LOCATION, "", Collections.singletonList(reservedName));
reserved.add(reservedElem);
}
for (DescriptorProto.ReservedRange reservedRange : descriptor.getReservedRangeList()) {
List<IntRange> values = new ArrayList<>();
int start = reservedRange.getStart();
int end = reservedRange.getEnd() - 1;
values.add(new IntRange(start, end));
ReservedElement reservedElem = new ReservedElement(DEFAULT_LOCATION, "", values);
reserved.add(reservedElem);
}
for (DescriptorProto.ExtensionRange extensionRange : descriptor.getExtensionRangeList()) {
List<IntRange> values = new ArrayList<>();
int start = extensionRange.getStart();
int end = extensionRange.getEnd() - 1;
values.add(new IntRange(start, end));
ExtensionsElement extensionsElement = new ExtensionsElement(DEFAULT_LOCATION, "", values);
extensions.add(extensionsElement);
}
ImmutableList.Builder<OptionElement> options = ImmutableList.builder();
if (descriptor.getOptions().hasMapEntry()) {
OptionElement option = new OptionElement(MAP_ENTRY_OPTION, booleanKind, descriptor.getOptions().getMapEntry(), false);
options.add(option);
}
if (descriptor.getOptions().hasNoStandardDescriptorAccessor()) {
OptionElement option = new OptionElement(NO_STANDARD_DESCRIPTOR_OPTION, booleanKind, descriptor.getOptions().getNoStandardDescriptorAccessor(), false);
options.add(option);
}
return new MessageElement(DEFAULT_LOCATION, name, "", nested.build(), options.build(), reserved.build(), fields.build(), oneofs.stream().filter(e -> e.getValue().build().size() != 0).map(e -> toOneof(e.getKey(), e.getValue())).collect(Collectors.toList()), extensions.build(), Collections.emptyList());
}
use of com.squareup.wire.schema.internal.parser.ReservedElement in project schema-registry by confluentinc.
the class ProtobufSchema method toDynamicMessage.
private static MessageDefinition toDynamicMessage(Syntax syntax, MessageElement messageElem) {
log.trace("*** message: {}", messageElem.getName());
MessageDefinition.Builder message = MessageDefinition.newBuilder(messageElem.getName());
for (TypeElement type : messageElem.getNestedTypes()) {
if (type instanceof MessageElement) {
message.addMessageDefinition(toDynamicMessage(syntax, (MessageElement) type));
} else if (type instanceof EnumElement) {
message.addEnumDefinition(toDynamicEnum((EnumElement) type));
}
}
Set<String> added = new HashSet<>();
for (OneOfElement oneof : messageElem.getOneOfs()) {
MessageDefinition.OneofBuilder oneofBuilder = message.addOneof(oneof.getName());
for (FieldElement field : oneof.getFields()) {
String defaultVal = field.getDefaultValue();
String jsonName = field.getJsonName();
Map<String, OptionElement> options = mergeOptions(field.getOptions());
CType ctype = findOption(CTYPE, options).map(o -> CType.valueOf(o.getValue().toString())).orElse(null);
JSType jstype = findOption(JSTYPE, options).map(o -> JSType.valueOf(o.getValue().toString())).orElse(null);
Boolean isDeprecated = findOption(DEPRECATED, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
Optional<OptionElement> meta = findOption(CONFLUENT_FIELD_META, options);
String doc = findDoc(meta);
Map<String, String> params = findParams(meta);
oneofBuilder.addField(false, field.getType(), field.getName(), field.getTag(), defaultVal, jsonName, doc, params, ctype, jstype, isDeprecated);
added.add(field.getName());
}
}
// Process fields after messages so that any newly created map entry messages are at the end
for (FieldElement field : messageElem.getFields()) {
if (added.contains(field.getName())) {
continue;
}
Field.Label fieldLabel = field.getLabel();
String label = fieldLabel != null ? fieldLabel.toString().toLowerCase() : null;
boolean isProto3Optional = "optional".equals(label) && syntax == Syntax.PROTO_3;
String fieldType = field.getType();
String defaultVal = field.getDefaultValue();
String jsonName = field.getJsonName();
Map<String, OptionElement> options = mergeOptions(field.getOptions());
CType ctype = findOption(CTYPE, options).map(o -> CType.valueOf(o.getValue().toString())).orElse(null);
Boolean isPacked = findOption(PACKED, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
JSType jstype = findOption(JSTYPE, options).map(o -> JSType.valueOf(o.getValue().toString())).orElse(null);
Boolean isDeprecated = findOption(DEPRECATED, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
Optional<OptionElement> meta = findOption(CONFLUENT_FIELD_META, options);
String doc = findDoc(meta);
Map<String, String> params = findParams(meta);
ProtoType protoType = ProtoType.get(fieldType);
ProtoType keyType = protoType.getKeyType();
ProtoType valueType = protoType.getValueType();
// Map fields are only permitted in messages
if (protoType.isMap() && keyType != null && valueType != null) {
label = "repeated";
fieldType = toMapEntry(field.getName());
MessageDefinition.Builder mapMessage = MessageDefinition.newBuilder(fieldType);
mapMessage.setMapEntry(true);
mapMessage.addField(null, keyType.toString(), KEY_FIELD, 1, null, null, null);
mapMessage.addField(null, valueType.toString(), VALUE_FIELD, 2, null, null, null);
message.addMessageDefinition(mapMessage.build());
}
if (isProto3Optional) {
// Add synthetic oneof after real oneofs
MessageDefinition.OneofBuilder oneofBuilder = message.addOneof("_" + field.getName());
oneofBuilder.addField(true, fieldType, field.getName(), field.getTag(), defaultVal, jsonName, doc, params, ctype, jstype, isDeprecated);
} else {
message.addField(label, fieldType, field.getName(), field.getTag(), defaultVal, jsonName, doc, params, ctype, isPacked, jstype, isDeprecated);
}
}
for (ReservedElement reserved : messageElem.getReserveds()) {
for (Object elem : reserved.getValues()) {
if (elem instanceof String) {
message.addReservedName((String) elem);
} else if (elem instanceof Integer) {
int tag = (Integer) elem;
message.addReservedRange(tag, tag + 1);
} else if (elem instanceof IntRange) {
IntRange range = (IntRange) elem;
message.addReservedRange(range.getStart(), range.getEndInclusive() + 1);
} else {
throw new IllegalStateException("Unsupported reserved type: " + elem.getClass().getName());
}
}
}
Map<String, OptionElement> options = mergeOptions(messageElem.getOptions());
Boolean noStandardDescriptorAccessor = findOption(NO_STANDARD_DESCRIPTOR_ACCESSOR, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
if (noStandardDescriptorAccessor != null) {
message.setNoStandardDescriptorAccessor(noStandardDescriptorAccessor);
}
Boolean isDeprecated = findOption(DEPRECATED, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
if (isDeprecated != null) {
message.setDeprecated(isDeprecated);
}
Boolean isMapEntry = findOption(MAP_ENTRY, options).map(o -> Boolean.valueOf(o.getValue().toString())).orElse(null);
if (isMapEntry != null) {
message.setMapEntry(isMapEntry);
}
Optional<OptionElement> meta = findOption(CONFLUENT_MESSAGE_META, options);
String doc = findDoc(meta);
Map<String, String> params = findParams(meta);
message.setMeta(doc, params);
return message.build();
}
Aggregations