org.hibernate.search.analyzer.definition.impl.LuceneAnalysisDefinitionUtils Maven / Gradle / Ivy
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.analyzer.definition.impl;
import java.util.List;
import java.util.function.IntFunction;
/**
* @author Yoann Rodiere
*/
public final class LuceneAnalysisDefinitionUtils {
private LuceneAnalysisDefinitionUtils() {
// Cannot be instantiated.
}
public static T[] buildAll(List extends LuceneAnalysisDefinitionBuilder> builders, IntFunction arraySupplier) {
int index = 0;
T[] result = arraySupplier.apply( builders.size() );
for ( LuceneAnalysisDefinitionBuilder builder : builders ) {
result[index] = builder.build();
++index;
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy