@Test public void testColumnTransformerValues() throws Exception { Map<String, Function> map = new HashMap<>(); map.put("trafo", new Function() { @Override public String[] parameters() { return null; } @Override public String getString(Values parameters) { assertFalse(parameters.hasValue("unknwon")); assertTrue(parameters.hasValue("column")); assertFalse(parameters.getBoolean("unknown")); assertEquals("", parameters.getString("unknown")); return parameters.getString("column"); } @Override public void getFunctionDialogReferences(Collection<String> set) { } @Override public boolean getBoolean(Values parameters) { return false; } }); ColumnTransformer transformer = new ColumnTransformer(map); assertEquals("value", transformer.get("trafo", new MockDataset())); }
public String get(String columnName, Dataset ds) throws ColumnNotFoundException { Function func = columnTranslations.get(columnName); if (func == null) { return ds.get(columnName); } return func.getString(new DatasetValues(ds)); }
ColumnTransformer { public String get(String columnName, Dataset ds) throws ColumnNotFoundException { Function func = columnTranslations.get(columnName); if (func == null) { return ds.get(columnName); } return func.getString(new DatasetValues(ds)); } }
ColumnTransformer { public String get(String columnName, Dataset ds) throws ColumnNotFoundException { Function func = columnTranslations.get(columnName); if (func == null) { return ds.get(columnName); } return func.getString(new DatasetValues(ds)); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); }
ColumnTransformer { public String get(String columnName, Dataset ds) throws ColumnNotFoundException { Function func = columnTranslations.get(columnName); if (func == null) { return ds.get(columnName); } return func.getString(new DatasetValues(ds)); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); boolean hasPseudoColumn(String name); List<String> getSchema(); String get(String columnName, Dataset ds); Dataset transform(Dataset ds); QueryResults transform(QueryResults qres); }
ColumnTransformer { public String get(String columnName, Dataset ds) throws ColumnNotFoundException { Function func = columnTranslations.get(columnName); if (func == null) { return ds.get(columnName); } return func.getString(new DatasetValues(ds)); } ColumnTransformer(Map<String, Function> trafos);  ColumnTransformer(); boolean hasPseudoColumn(String name); List<String> getSchema(); String get(String columnName, Dataset ds); Dataset transform(Dataset ds); QueryResults transform(QueryResults qres);  }