private void buildConfig(DataType type, DocumenttypesConfig.Documenttype.Builder documentBuilder, Set<Integer> built) {
if ((VespaDocumentType.INSTANCE.getDataType(type.getId()) == null) && !built.contains(type.getId())) {
built.add(type.getId());
DocumenttypesConfig.Documenttype.Datatype.Builder dataTypeBuilder = new DocumenttypesConfig.Documenttype.Datatype.Builder();
dataTypeBuilder.id(type.getId());
if (type instanceof StructDataType) {
buildConfig((StructDataType) type, dataTypeBuilder, documentBuilder, built);
} else if (type instanceof ArrayDataType) {
buildConfig((ArrayDataType) type, dataTypeBuilder, documentBuilder, built);
} else if (type instanceof WeightedSetDataType) {
buildConfig((WeightedSetDataType) type, dataTypeBuilder, documentBuilder, built);
} else if (type instanceof MapDataType) {
buildConfig((MapDataType) type, dataTypeBuilder, documentBuilder, built);
} else if (type instanceof AnnotationReferenceDataType) {
buildConfig((AnnotationReferenceDataType) type, dataTypeBuilder);
} else if (type instanceof TensorDataType) {
return;
} else if (type instanceof ReferenceDataType) {
buildConfig((ReferenceDataType) type, documentBuilder);
return;
} else {
return;
}
documentBuilder.datatype(dataTypeBuilder);
}
}