public final class QueryNormalizer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SET_SEPARATOR
String used to separate distinct sets when using `%Ss` in a query
|
static String |
SET_SUBSTITUTOR
String used to specify a substitution location of a set which is specified as a list of
newline-separated strings which follow the query itself
|
Constructor and Description |
---|
QueryNormalizer() |
Modifier and Type | Method and Description |
---|---|
static String |
normalize(String query)
Format query using list substitution If the first line of the query contains %Ss then
subsequent lines are treated as replacement strings
|
static String |
normalizePattern(String pattern,
List<String> formatArgs)
Format query using list substitution
|
public static final String SET_SEPARATOR
public static final String SET_SUBSTITUTOR
public static String normalizePattern(String pattern, List<String> formatArgs) throws QueryException
pattern
- Query that contains one or more %SsformatArgs
- Replacement strings for each %Ss occurrence, if there is just on replacement
then all %sS instance would be replaced with it. If there is another mismatch between
number of %Ss and replacement strings then the error is raisedQueryException
public static String normalize(String query) throws QueryException
QueryException