@Test public void partial() { ParameterTable t = new BasicParameterTable.BasicBuilder() .next().put("a", "A1").put("b", "B1").put("c", "C1") .next().put("a", "A2").put("b", "B2") .next().put("a", "A3").put("c", "C3") .build(); assertThat(t.getPartial(), containsInAnyOrder("b", "c")); }
@Override public Set<String> getPartial() { Set<String> available = getAvailable(); Set<String> results = new HashSet<>(); for (Map<String, String> map : entity) { for (String key : available) { if (map.get(key) == null) { results.add(key); } } if (available.size() == results.size()) { break; } } return results; }
BasicParameterTable implements ParameterTable { @Override public Set<String> getPartial() { Set<String> available = getAvailable(); Set<String> results = new HashSet<>(); for (Map<String, String> map : entity) { for (String key : available) { if (map.get(key) == null) { results.add(key); } } if (available.size() == results.size()) { break; } } return results; } }
BasicParameterTable implements ParameterTable { @Override public Set<String> getPartial() { Set<String> available = getAvailable(); Set<String> results = new HashSet<>(); for (Map<String, String> map : entity) { for (String key : available) { if (map.get(key) == null) { results.add(key); } } if (available.size() == results.size()) { break; } } return results; } BasicParameterTable(List<? extends Map<String, String>> entity); }
BasicParameterTable implements ParameterTable { @Override public Set<String> getPartial() { Set<String> available = getAvailable(); Set<String> results = new HashSet<>(); for (Map<String, String> map : entity) { for (String key : available) { if (map.get(key) == null) { results.add(key); } } if (available.size() == results.size()) { break; } } return results; } BasicParameterTable(List<? extends Map<String, String>> entity); @Override Iterator<ParameterSet> iterator(); @Override boolean isEmpty(); @Override int getRowCount(); @Override Cursor newCursor(); @Override Set<String> getAvailable(); @Override Set<String> getPartial(); @Override List<ParameterSet> getRows(); }
BasicParameterTable implements ParameterTable { @Override public Set<String> getPartial() { Set<String> available = getAvailable(); Set<String> results = new HashSet<>(); for (Map<String, String> map : entity) { for (String key : available) { if (map.get(key) == null) { results.add(key); } } if (available.size() == results.size()) { break; } } return results; } BasicParameterTable(List<? extends Map<String, String>> entity); @Override Iterator<ParameterSet> iterator(); @Override boolean isEmpty(); @Override int getRowCount(); @Override Cursor newCursor(); @Override Set<String> getAvailable(); @Override Set<String> getPartial(); @Override List<ParameterSet> getRows();  }