/** * Returns whether the index is covering exactly the fields given independently of the order. * * @param keys must not be {@literal null}. * @return */ public boolean isIndexForFields(Collection<String> keys) { Assert.notNull(keys, "Collection of keys must not be null!"); List<String> indexKeys = new ArrayList<String>(indexFields.size()); for (IndexField field : indexFields) { indexKeys.add(field.getKey()); } return indexKeys.containsAll(keys); }
/** * Returns whether the index is covering exactly the fields given independently of the order. * * @param keys must not be {@literal null}. * @return */ public boolean isIndexForFields(Collection<String> keys) { Assert.notNull(keys, "Collection of keys must not be null!"); List<String> indexKeys = new ArrayList<String>(indexFields.size()); for (IndexField field : indexFields) { indexKeys.add(field.getKey()); } return indexKeys.containsAll(keys); }