public static <T> Collector<T> newCollector() { return new Collector<T>(); }
private QueryTemplateBuilder() { this.namedGraphs=Collector.newCollector(); }
public String indent() { return IndentUtils.tab(level); }
@Test public void testCollect$enum$different() throws Exception { sut.collect(valueArrayDifferent); verifyDifferent(sut.asSet(), sut.asList()); }
@Test public void testCollect$list$repeated() throws Exception { sut.collect(valueListRepeated); verifyRepeated(sut.asSet(), sut.asList()); }
@Test public void testIndentUtils$noLevel() throws Exception { IndentUtils sut=new IndentUtils(); assertThat(sut.indent(),isEmptyString()); }
/** * @param indenter * @param format * @param args * @return */ private String block(IndentUtils indenter, String format, Object... args) { String indentation = indenter.indent(); String newLine = "\n\t".concat(indentation); String rawText = String.format(indentation.concat(format),args); String block = rawText.replaceAll("\n", newLine); return block; }
GraphRenderer(Graph graph, boolean enableFolding) { this.disableFolding = !enableFolding; this.graph = graph; this.base = graph.getBase(); this.namespaces = graph.getNamespaces(); this.builder = new StringBuilder(); this.utils = new TurtleValueUtils((URI)base,namespaces); this.indenter = new IndentUtils(1); }
public T withRequiredNamedGraphs(Iterable<String> namedGraphs) { this.namedGraphs.collect(namedGraphs); return getBuilder(); }
protected void populateTemplate(AbstractQueryTemplate template) { template.setDefaultGraph(defaultGraphName); template.setNamedGraphs(namedGraphs.asSet()); }
@Test public void testCollect$iterable$different() throws Exception { sut.collect( new Iterable<String>(){ @Override public Iterator<String> iterator() { return valueListDifferent.iterator(); } } ); verifyDifferent(sut.asSet(), sut.asList()); }
@Test public void testCollect$enum$repeated() throws Exception { sut.collect(valueArrayRepeated); verifyRepeated(sut.asSet(), sut.asList()); }
private void indent(String format, Object... args) { if(LOGGER.isTraceEnabled()) { LOGGER.trace(String.format(ind.indent().concat(format),args)); } } private void log(Object obj) {
public List<String> extract(String item) { List<String> result = doChaining(new IndentUtils(), item); if(LOGGER.isDebugEnabled()) { debug(new IndentUtils(),"Extraction completed:\n-Data:\n%s\n-Result: %s",item,result); } return result; }
public T withRequiredNamedGraphs(String... namedGraphs) { this.namedGraphs.collect(namedGraphs); return getBuilder(); }
@Before public void setUp() throws Exception { sut=Collector.<String>newCollector(); valueArrayDifferent = new String[]{"String1","String2","String3"}; valueListDifferent = Arrays.asList(valueArrayDifferent); valueArrayRepeated = new String[]{"String1","String2","String3","String1"}; valueListRepeated = Arrays.asList(valueArrayRepeated); }
@Test public void testCollect$list$different() throws Exception { sut.collect(valueListDifferent); verifyDifferent(sut.asSet(), sut.asList()); }
@Test public void testCollect$iterable$repeated() throws Exception { sut.collect( new Iterable<String>(){ @Override public Iterator<String> iterator() { return valueListRepeated.iterator(); } } ); verifyRepeated(sut.asSet(), sut.asList()); }
private void indent(String format, Object... args) { if(LOGGER.isTraceEnabled()) { LOGGER.trace(String.format(ind.indent().concat(format),args)); } }
public T withRequiredNamedGraphs(Collection<String> namedGraphs) { this.namedGraphs.collect(namedGraphs); return getBuilder(); }