@Test public void writeHeader() throws IOException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); csvExportStrategy.writeHeader(byteArrayOutputStream, Stream.of("header1", "header2", "header3") .map(s -> FieldInfo.builder().displayName(s).build()) .collect(Collectors.toList())); assertThat(byteArrayOutputStream.toString(), endsWith("header1,header2,header3\r\n")); }
@Override public void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames) throws IOException { outputStream.write(UTF8_BOM); exportRecord(outputStream, fieldNames.stream() .map(FieldInfo::getDisplayName) .collect(Collectors.toList())); }
CsvExportStrategy implements PlatformDataExportStrategy { @Override public void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames) throws IOException { outputStream.write(UTF8_BOM); exportRecord(outputStream, fieldNames.stream() .map(FieldInfo::getDisplayName) .collect(Collectors.toList())); } }
CsvExportStrategy implements PlatformDataExportStrategy { @Override public void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames) throws IOException { outputStream.write(UTF8_BOM); exportRecord(outputStream, fieldNames.stream() .map(FieldInfo::getDisplayName) .collect(Collectors.toList())); } @Autowired  CsvExportStrategy(final ConfigService<? extends HavenSearchCapable> configService,
                             final FieldPathNormaliser fieldPathNormaliser,
                             final FieldDisplayNameGenerator fieldDisplayNameGenerator); }
CsvExportStrategy implements PlatformDataExportStrategy { @Override public void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames) throws IOException { outputStream.write(UTF8_BOM); exportRecord(outputStream, fieldNames.stream() .map(FieldInfo::getDisplayName) .collect(Collectors.toList())); } @Autowired  CsvExportStrategy(final ConfigService<? extends HavenSearchCapable> configService,
                             final FieldPathNormaliser fieldPathNormaliser,
                             final FieldDisplayNameGenerator fieldDisplayNameGenerator); @Override void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames); @Override List<FieldInfo<?>> getFieldNames(final MetadataNode[] metadataNodes, final Collection<String> selectedFieldIds); @Override Map<String, FieldInfo<?>> getConfiguredFieldsById(); @Override Optional<FieldInfo<Serializable>> getFieldInfoForMetadataNode(final String nodeName, final Map<String, ? extends MetadataNode> metadataNodes, final Collection<String> selectedFieldIds); @SuppressWarnings({"unchecked", "rawtypes"}) @Override Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds); @Override String getDisplayValue(final FieldInfo<?> fieldInfo, final T value); @Override void exportRecord(final OutputStream outputStream, final Iterable<String> values); @Override // CAUTION: Method has more than one exit point. String combineValues(final List<String> maybeValues); @Override ExportFormat getExportFormat(); }
CsvExportStrategy implements PlatformDataExportStrategy { @Override public void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames) throws IOException { outputStream.write(UTF8_BOM); exportRecord(outputStream, fieldNames.stream() .map(FieldInfo::getDisplayName) .collect(Collectors.toList())); } @Autowired  CsvExportStrategy(final ConfigService<? extends HavenSearchCapable> configService,
                             final FieldPathNormaliser fieldPathNormaliser,
                             final FieldDisplayNameGenerator fieldDisplayNameGenerator); @Override void writeHeader(final OutputStream outputStream, final Collection<FieldInfo<?>> fieldNames); @Override List<FieldInfo<?>> getFieldNames(final MetadataNode[] metadataNodes, final Collection<String> selectedFieldIds); @Override Map<String, FieldInfo<?>> getConfiguredFieldsById(); @Override Optional<FieldInfo<Serializable>> getFieldInfoForMetadataNode(final String nodeName, final Map<String, ? extends MetadataNode> metadataNodes, final Collection<String> selectedFieldIds); @SuppressWarnings({"unchecked", "rawtypes"}) @Override Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds); @Override String getDisplayValue(final FieldInfo<?> fieldInfo, final T value); @Override void exportRecord(final OutputStream outputStream, final Iterable<String> values); @Override // CAUTION: Method has more than one exit point. String combineValues(final List<String> maybeValues); @Override ExportFormat getExportFormat();  }