@SuppressWarnings("OptionalGetWithoutIsPresent") @Test public void getFieldInfoForKnownNode() { final Optional<? extends FieldInfo<?>> maybeAuthorInfo = csvExportStrategy.getFieldInfoForNode("author", Collections.singletonList("authors")); assertTrue(maybeAuthorInfo.isPresent()); assertEquals("Authors", maybeAuthorInfo.get().getDisplayName()); }
@SuppressWarnings({"unchecked", "rawtypes"}) @Override public Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds) { final Optional<FieldInfo<?>> maybeFieldInfo = Optional.ofNullable(getFieldsInfo().getFieldConfigByName().get(fieldPathNormaliser.normaliseFieldPath(nodeName))); return maybeFieldInfo .filter(fieldInfo -> selected(selectedFieldIds, fieldInfo.getId())); }
CsvExportStrategy implements PlatformDataExportStrategy { @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds) { final Optional<FieldInfo<?>> maybeFieldInfo = Optional.ofNullable(getFieldsInfo().getFieldConfigByName().get(fieldPathNormaliser.normaliseFieldPath(nodeName))); return maybeFieldInfo .filter(fieldInfo -> selected(selectedFieldIds, fieldInfo.getId())); } }
CsvExportStrategy implements PlatformDataExportStrategy { @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds) { final Optional<FieldInfo<?>> maybeFieldInfo = Optional.ofNullable(getFieldsInfo().getFieldConfigByName().get(fieldPathNormaliser.normaliseFieldPath(nodeName))); return maybeFieldInfo .filter(fieldInfo -> selected(selectedFieldIds, fieldInfo.getId())); } @Autowired  CsvExportStrategy(final ConfigService<? extends HavenSearchCapable> configService,
                             final FieldPathNormaliser fieldPathNormaliser,
                             final FieldDisplayNameGenerator fieldDisplayNameGenerator); }
CsvExportStrategy implements PlatformDataExportStrategy { @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds) { final Optional<FieldInfo<?>> maybeFieldInfo = Optional.ofNullable(getFieldsInfo().getFieldConfigByName().get(fieldPathNormaliser.normaliseFieldPath(nodeName))); return maybeFieldInfo .filter(fieldInfo -> selected(selectedFieldIds, fieldInfo.getId())); } @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 { @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Optional<FieldInfo<?>> getFieldInfoForNode(final String nodeName, final Collection<String> selectedFieldIds) { final Optional<FieldInfo<?>> maybeFieldInfo = Optional.ofNullable(getFieldsInfo().getFieldConfigByName().get(fieldPathNormaliser.normaliseFieldPath(nodeName))); return maybeFieldInfo .filter(fieldInfo -> selected(selectedFieldIds, fieldInfo.getId())); } @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();  }