private void buildConfig(StructDataType type, DocumenttypesConfig.Documenttype.Datatype.Builder dataTypeBuilder, DocumenttypesConfig.Documenttype.Builder documentBuilder, Set<Integer> built) { dataTypeBuilder.type(DocumenttypesConfig.Documenttype.Datatype.Type.Enum.STRUCT); DocumenttypesConfig.Documenttype.Datatype.Sstruct.Builder structBuilder = new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Builder(); dataTypeBuilder.sstruct(structBuilder); structBuilder.name(type.getName()); if (type.getCompressionConfig().type.getCode() != 0) { structBuilder.compression(new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Compression.Builder(). type(DocumenttypesConfig.Documenttype.Datatype.Sstruct.Compression.Type.Enum.valueOf(type.getCompressionConfig().type.toString())). level(type.getCompressionConfig().compressionLevel). threshold((int) type.getCompressionConfig().threshold). minsize((int) type.getCompressionConfig().minsize)); } for (com.yahoo.document.Field field : type.getFields()) { DocumenttypesConfig.Documenttype.Datatype.Sstruct.Field.Builder builder = new DocumenttypesConfig.Documenttype.Datatype.Sstruct.Field.Builder(); builder.name(field.getName()). id(field.getId()). id_v6(field.getIdV6()). datatype(field.getDataType().getId()); if (field.getDataType() instanceof TensorDataType) { builder.detailedtype(((TensorDataType) field.getDataType()).getTensorType().toString()); } structBuilder.field(builder); buildConfig(field.getDataType(), documentBuilder, built); } }
public Builder(Field config) { name(config.name()); id(config.id()); id_v6(config.id_v6()); datatype(config.datatype()); detailedtype(config.detailedtype()); }
private Builder override(Builder __superior) { if (__superior.name != null) name(__superior.name); if (__superior.id != null) id(__superior.id); if (__superior.id_v6 != null) id_v6(__superior.id_v6); if (__superior.datatype != null) datatype(__superior.datatype); if (__superior.detailedtype != null) detailedtype(__superior.detailedtype); return this; }