@Test public void filterResultsWithTwoColumnsButNotString() { List<Object> results = Collections.singletonList(new Object[]{ 23, "Path.To.Page" }); assertSame(results, this.filter.filterResults(results)); }
@Override public List filterResults(List results) { for (int i = 0; i < results.size(); i++) { Object result = results.get(i); if (result instanceof String) { results.set(i, this.documentReferenceResolver.resolve((String) result)); } else if (result instanceof Object[]) { Object[] row = (Object[]) result; if (row.length > 0 && row[0] instanceof String) { row[0] = this.documentReferenceResolver.resolve((String) row[0]); } } } return results; }
DocumentQueryFilter implements QueryFilter { @Override public List filterResults(List results) { for (int i = 0; i < results.size(); i++) { Object result = results.get(i); if (result instanceof String) { results.set(i, this.documentReferenceResolver.resolve((String) result)); } else if (result instanceof Object[]) { Object[] row = (Object[]) result; if (row.length > 0 && row[0] instanceof String) { row[0] = this.documentReferenceResolver.resolve((String) row[0]); } } } return results; } }
DocumentQueryFilter implements QueryFilter { @Override public List filterResults(List results) { for (int i = 0; i < results.size(); i++) { Object result = results.get(i); if (result instanceof String) { results.set(i, this.documentReferenceResolver.resolve((String) result)); } else if (result instanceof Object[]) { Object[] row = (Object[]) result; if (row.length > 0 && row[0] instanceof String) { row[0] = this.documentReferenceResolver.resolve((String) row[0]); } } } return results; }  }
DocumentQueryFilter implements QueryFilter { @Override public List filterResults(List results) { for (int i = 0; i < results.size(); i++) { Object result = results.get(i); if (result instanceof String) { results.set(i, this.documentReferenceResolver.resolve((String) result)); } else if (result instanceof Object[]) { Object[] row = (Object[]) result; if (row.length > 0 && row[0] instanceof String) { row[0] = this.documentReferenceResolver.resolve((String) row[0]); } } } return results; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results); }
DocumentQueryFilter implements QueryFilter { @Override public List filterResults(List results) { for (int i = 0; i < results.size(); i++) { Object result = results.get(i); if (result instanceof String) { results.set(i, this.documentReferenceResolver.resolve((String) result)); } else if (result instanceof Object[]) { Object[] row = (Object[]) result; if (row.length > 0 && row[0] instanceof String) { row[0] = this.documentReferenceResolver.resolve((String) row[0]); } } } return results; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results);  }