All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.zulia.util.QueryHelper Maven / Gradle / Ivy

There is a newer version: 1.6.4
Show newest version
package io.zulia.util;

import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * Created by mdavis on 3/27/16.
 */
public class QueryHelper {

	public final static Function ADD_QUOTES = (s) -> '"' + s + '"';

	public static String getOrQuery(String field, Collection values, Function modifier) {
		return field + ":" + values.stream().map(modifier).collect(Collectors.joining(" OR "));
	}

	public static String getOrTerms(Collection values, Function modifier) {
		return values.stream().map(modifier).collect(Collectors.joining(" OR "));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy