Class RegexQueryPartReplacer (0.27.0)

public class RegexQueryPartReplacer implements QueryPartReplacer

QueryPartReplacer that replaces a regex java.util.regex.Pattern with a fixed string.

Inheritance

java.lang.Object > RegexQueryPartReplacer

Implements

QueryPartReplacer

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.

Parameters
Name Description
pattern Pattern
replacement String
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.

Parameters
Name Description
pattern Pattern
replacement Supplier<String>
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.

Parameters
Name Description
pattern Pattern
replacement String
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.

Parameters
Name Description
pattern Pattern
replacement String
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.

Parameters
Name Description
pattern Pattern
replacement Supplier<String>
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>