@Test void selectById() { final String foo = new DocumentationResourceImpl() .selectById("Foo1", "== Foo0\n\n00000\n\n" + "=== Configuration\n\nWhatever0\n\n== Foo1\n\nThe description\n\n" + "=== Configuration\n\nWhatever1\n\n" + "== Foo2\n\n2222\n\n=== Configuration\n\nWhatever2", DocumentationResourceImpl.DocumentationSegment.DESCRIPTION); assertEquals("The description", foo.trim()); }
String selectById(final String name, final String value, final DocumentationSegment segment) { final List<String> lines; try (final BufferedReader reader = new BufferedReader(new StringReader(value))) { lines = reader.lines().collect(toList()); } catch (final IOException e) { throw new IllegalArgumentException(e); } return extractUsingComments(name, lines, segment) .orElseGet(() -> noMarkingCommentFallbackExtraction(name, lines, segment, value)); }
DocumentationResourceImpl implements DocumentationResource { String selectById(final String name, final String value, final DocumentationSegment segment) { final List<String> lines; try (final BufferedReader reader = new BufferedReader(new StringReader(value))) { lines = reader.lines().collect(toList()); } catch (final IOException e) { throw new IllegalArgumentException(e); } return extractUsingComments(name, lines, segment) .orElseGet(() -> noMarkingCommentFallbackExtraction(name, lines, segment, value)); } }
DocumentationResourceImpl implements DocumentationResource { String selectById(final String name, final String value, final DocumentationSegment segment) { final List<String> lines; try (final BufferedReader reader = new BufferedReader(new StringReader(value))) { lines = reader.lines().collect(toList()); } catch (final IOException e) { throw new IllegalArgumentException(e); } return extractUsingComments(name, lines, segment) .orElseGet(() -> noMarkingCommentFallbackExtraction(name, lines, segment, value)); }  }
DocumentationResourceImpl implements DocumentationResource { String selectById(final String name, final String value, final DocumentationSegment segment) { final List<String> lines; try (final BufferedReader reader = new BufferedReader(new StringReader(value))) { lines = reader.lines().collect(toList()); } catch (final IOException e) { throw new IllegalArgumentException(e); } return extractUsingComments(name, lines, segment) .orElseGet(() -> noMarkingCommentFallbackExtraction(name, lines, segment, value)); }  @Override DocumentationContent getDocumentation(final String id, final String language,
            final DocumentationSegment segment); }
DocumentationResourceImpl implements DocumentationResource { String selectById(final String name, final String value, final DocumentationSegment segment) { final List<String> lines; try (final BufferedReader reader = new BufferedReader(new StringReader(value))) { lines = reader.lines().collect(toList()); } catch (final IOException e) { throw new IllegalArgumentException(e); } return extractUsingComments(name, lines, segment) .orElseGet(() -> noMarkingCommentFallbackExtraction(name, lines, segment, value)); }  @Override DocumentationContent getDocumentation(final String id, final String language,
            final DocumentationSegment segment);  }