@Test public void testCreateFilterWithEmptyParam() { OverrideConfigFilter filter = new OverrideConfigFilter(List::of); assertThat(filter, notNullValue()); assertThat(filter.apply(Config.Key.create("name"), "ondrej"), is("ondrej")); }
@Override public String apply(Config.Key key, String stringValue) { List<Map.Entry<Predicate<Config.Key>, String>> overrideValues = overrideValuesSupplier.get(); if (overrideValues != null) { for (Map.Entry<Predicate<Config.Key>, String> entry : overrideValues) { if (entry.getKey().test(key)) { return entry.getValue(); } } } return stringValue; }
OverrideConfigFilter implements ConfigFilter { @Override public String apply(Config.Key key, String stringValue) { List<Map.Entry<Predicate<Config.Key>, String>> overrideValues = overrideValuesSupplier.get(); if (overrideValues != null) { for (Map.Entry<Predicate<Config.Key>, String> entry : overrideValues) { if (entry.getKey().test(key)) { return entry.getValue(); } } } return stringValue; } }
OverrideConfigFilter implements ConfigFilter { @Override public String apply(Config.Key key, String stringValue) { List<Map.Entry<Predicate<Config.Key>, String>> overrideValues = overrideValuesSupplier.get(); if (overrideValues != null) { for (Map.Entry<Predicate<Config.Key>, String> entry : overrideValues) { if (entry.getKey().test(key)) { return entry.getValue(); } } } return stringValue; } OverrideConfigFilter(Supplier<List<Map.Entry<Predicate<Config.Key>, String>>> overrideValuesSupplier); }
OverrideConfigFilter implements ConfigFilter { @Override public String apply(Config.Key key, String stringValue) { List<Map.Entry<Predicate<Config.Key>, String>> overrideValues = overrideValuesSupplier.get(); if (overrideValues != null) { for (Map.Entry<Predicate<Config.Key>, String> entry : overrideValues) { if (entry.getKey().test(key)) { return entry.getValue(); } } } return stringValue; } OverrideConfigFilter(Supplier<List<Map.Entry<Predicate<Config.Key>, String>>> overrideValuesSupplier); @Override String apply(Config.Key key, String stringValue); }
OverrideConfigFilter implements ConfigFilter { @Override public String apply(Config.Key key, String stringValue) { List<Map.Entry<Predicate<Config.Key>, String>> overrideValues = overrideValuesSupplier.get(); if (overrideValues != null) { for (Map.Entry<Predicate<Config.Key>, String> entry : overrideValues) { if (entry.getKey().test(key)) { return entry.getValue(); } } } return stringValue; } OverrideConfigFilter(Supplier<List<Map.Entry<Predicate<Config.Key>, String>>> overrideValuesSupplier); @Override String apply(Config.Key key, String stringValue);  }