@Test public void testCollectionTemplate() throws Exception { CollectionHolder root = new CollectionHolder(Collections.emptyList()); Optional<Object> sanitizedOpt = new TemplateSanitizer( path -> path.equals("values") ? Optional.of(asList("a", "b")) : Optional.empty(), type -> true ).apply(root); assertThat(sanitizedOpt).isPresent(); }
@Override public Optional<Object> apply(Object entity) { return entity != null ? apply(entity, "") : Optional.empty(); }
TemplateSanitizer extends AbstractFieldSanitizer<String> { @Override public Optional<Object> apply(Object entity) { return entity != null ? apply(entity, "") : Optional.empty(); } }
TemplateSanitizer extends AbstractFieldSanitizer<String> { @Override public Optional<Object> apply(Object entity) { return entity != null ? apply(entity, "") : Optional.empty(); } TemplateSanitizer(Function<String, Optional<Object>> templateResolver,
                             Function<Class<?>, Boolean> innerEntityPredicate); }
TemplateSanitizer extends AbstractFieldSanitizer<String> { @Override public Optional<Object> apply(Object entity) { return entity != null ? apply(entity, "") : Optional.empty(); } TemplateSanitizer(Function<String, Optional<Object>> templateResolver,
                             Function<Class<?>, Boolean> innerEntityPredicate); @Override Optional<Object> apply(Object entity); }
TemplateSanitizer extends AbstractFieldSanitizer<String> { @Override public Optional<Object> apply(Object entity) { return entity != null ? apply(entity, "") : Optional.empty(); } TemplateSanitizer(Function<String, Optional<Object>> templateResolver,
                             Function<Class<?>, Boolean> innerEntityPredicate); @Override Optional<Object> apply(Object entity);  }