public Set<String> getIgnoredPaths() { return delegate.getIgnoredPaths(); }
private boolean isTypeRestricting(Example example) { if (example.getMatcher() instanceof UntypedExampleMatcher) { return false; } if (example.getMatcher().getIgnoredPaths().isEmpty()) { return true; } for (String path : example.getMatcher().getIgnoredPaths()) { if (this.converter.getTypeMapper().isTypeKey(path)) { return false; } } return true; }
public Set<String> getIgnoredPaths() { return delegate.getIgnoredPaths(); }
private boolean isTypeRestricting(Example example) { if (example.getMatcher() instanceof UntypedExampleMatcher) { return false; } if (example.getMatcher().getIgnoredPaths().isEmpty()) { return true; } for (String path : example.getMatcher().getIgnoredPaths()) { if (this.converter.getTypeMapper().isTypeKey(path)) { return false; } } return true; }
/** * @param path must not be {@literal null}. * @return return {@literal true} if path was set to be ignored. */ default boolean isIgnoredPath(String path) { return getIgnoredPaths().contains(path); }
private <T> void validateExample(Example<T> example) { Assert.notNull(example, "A non-null example is expected"); ExampleMatcher matcher = example.getMatcher(); if (!matcher.isAllMatching()) { throw new DatastoreDataException("Unsupported MatchMode. Only MatchMode.ALL is supported"); } if (matcher.isIgnoreCaseEnabled()) { throw new DatastoreDataException("Ignore case matching is not supported"); } if (!(matcher.getDefaultStringMatcher() == ExampleMatcher.StringMatcher.EXACT || matcher.getDefaultStringMatcher() == ExampleMatcher.StringMatcher.DEFAULT)) { throw new DatastoreDataException("Unsupported StringMatcher. Only EXACT and DEFAULT are supported"); } Optional<String> path = example.getMatcher().getIgnoredPaths().stream().filter((s) -> s.contains(".")).findFirst(); if (path.isPresent()) { throw new DatastoreDataException("Ignored paths deeper than 1 are not supported"); } if (matcher.getPropertySpecifiers().hasValues()) { throw new DatastoreDataException("Property matchers are not supported"); } } }