@Test public void fieldTest() throws IOException { BundleFilterField bff = Configs.decodeObject(BundleFilterField.class, "from: foo, filter {default = bar}"); MapBundle bundle = MapBundle.createBundle(new String[]{"dog", "food"}); bff.filter(bundle); assertEquals("food", bundle.get("dog")); assertEquals("bar", bundle.get("foo")); }
@Override public boolean filter(Bundle row) { ValueObject val = from.getValue(row); if (filter != null) { val = filter.filter(val, row); } if (nullFail && (val == null)) { return not; } if (to == null) { from.setValue(row, val); } else { to.setValue(row, val); } return !not; }
BundleFilterField implements BundleFilter { @Override public boolean filter(Bundle row) { ValueObject val = from.getValue(row); if (filter != null) { val = filter.filter(val, row); } if (nullFail && (val == null)) { return not; } if (to == null) { from.setValue(row, val); } else { to.setValue(row, val); } return !not; } }
BundleFilterField implements BundleFilter { @Override public boolean filter(Bundle row) { ValueObject val = from.getValue(row); if (filter != null) { val = filter.filter(val, row); } if (nullFail && (val == null)) { return not; } if (to == null) { from.setValue(row, val); } else { to.setValue(row, val); } return !not; }  }
BundleFilterField implements BundleFilter { @Override public boolean filter(Bundle row) { ValueObject val = from.getValue(row); if (filter != null) { val = filter.filter(val, row); } if (nullFail && (val == null)) { return not; } if (to == null) { from.setValue(row, val); } else { to.setValue(row, val); } return !not; }  BundleFilterField setNullFail(boolean nullFail); @Override boolean filter(Bundle row); }
BundleFilterField implements BundleFilter { @Override public boolean filter(Bundle row) { ValueObject val = from.getValue(row); if (filter != null) { val = filter.filter(val, row); } if (nullFail && (val == null)) { return not; } if (to == null) { from.setValue(row, val); } else { to.setValue(row, val); } return !not; }  BundleFilterField setNullFail(boolean nullFail); @Override boolean filter(Bundle row);  }