public class RegexQueryPartReplacer implements QueryPartReplacer
QueryPartReplacer that replaces a regex java.util.regex.Pattern with a fixed string.
Implements
QueryPartReplacerInherited Members
Static Methods
replace(Pattern pattern, String replacement)
public static RegexQueryPartReplacer replace(Pattern pattern, String replacement)
Replace all occurrences of the given pattern with the given static replacement.
Returns | |
---|---|
Type | Description |
RegexQueryPartReplacer |
replace(Pattern pattern, Supplier<String> replacement)
public static RegexQueryPartReplacer replace(Pattern pattern, Supplier<String> replacement)
Replace all occurrences of the given pattern with the value that is returned by the given Supplier function.
Returns | |
---|---|
Type | Description |
RegexQueryPartReplacer |
replaceAllAndStop(Pattern pattern, String replacement)
public static RegexQueryPartReplacer replaceAllAndStop(Pattern pattern, String replacement)
Replace the entire with the given static value and then stop.
Returns | |
---|---|
Type | Description |
RegexQueryPartReplacer |
replaceAndStop(Pattern pattern, String replacement)
public static RegexQueryPartReplacer replaceAndStop(Pattern pattern, String replacement)
Replace the first occurrence of the given pattern with the given static value and then stop.
Returns | |
---|---|
Type | Description |
RegexQueryPartReplacer |
replaceAndStop(Pattern pattern, Supplier<String> replacement)
public static RegexQueryPartReplacer replaceAndStop(Pattern pattern, Supplier<String> replacement)
Replace the first occurrence of the given pattern with the value that is returned by the given Supplier function and then stop.
Returns | |
---|---|
Type | Description |
RegexQueryPartReplacer |
Methods
replace(String sql)
public Tuple<String,QueryPartReplacer.ReplacementStatus> replace(String sql)
Replace unsupported SQL parts in the given SQL string and return the new SQL string.
Parameter | |
---|---|
Name | Description |
sql | String |
Returns | |
---|---|
Type | Description |
com.google.cloud.Tuple<String,ReplacementStatus> |