class FindPackageNamesQuery extends AbstractFindQuery implements NamedQuery {

    @Override
    public void validateTerms(Set<ValueIndexTerm> queryTerms) {
        checkNotNullAndNotEmpty(queryTerms);

        checkInvalidAndRequiredTerms(queryTerms,
                                     NAME,
                                     new String[]{
                                             null,   // not required
                                             packageNameIndexTerm.getTerm()
                                     },
                                     (t) -> (t instanceof ValueModuleRootPathIndexTerm),
                                     (t) -> (Objects.equals(t.getTerm(), packageNameIndexTerm.getTerm())));
    }

}