Package com.zendesk.maxwell.util
Class TopicInterpolator
- java.lang.Object
-
- com.zendesk.maxwell.util.TopicInterpolator
-
public class TopicInterpolator extends Object
An utility class to interpolate subscription, channel templates.An input string can contains any combination of: - %{db} - %{table} - %{type}
-
-
Constructor Summary
Constructors Constructor Description TopicInterpolator(String templateString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateFromRowIdentity(RowIdentity pk)Interpolate the input string based on {{RowIdentity}}StringgenerateFromRowMap(RowMap r)Interpolate the input string based on {{RowMap}}StringgenerateFromRowMapAndCleanUpIllegalCharacters(RowMap r)Interpolate the input string based on {{RowMap}} and clean up all non alpha-numeric charactersprotected Stringinterpolate(String database, String table, String type, Boolean cleanUpIllegalCharacters)
-
-
-
Constructor Detail
-
TopicInterpolator
public TopicInterpolator(String templateString)
-
-
Method Detail
-
generateFromRowIdentity
public String generateFromRowIdentity(RowIdentity pk)
Interpolate the input string based on {{RowIdentity}}If your inputString contains a %{type} it will not be interpolated because we can't get type from RowIdentity.
- Parameters:
pk- the rowIdentity- Returns:
- the interpollated string
-
generateFromRowMap
public String generateFromRowMap(RowMap r)
Interpolate the input string based on {{RowMap}}- Parameters:
r- the rowMap- Returns:
- the interpollated string
-
generateFromRowMapAndCleanUpIllegalCharacters
public String generateFromRowMapAndCleanUpIllegalCharacters(RowMap r)
Interpolate the input string based on {{RowMap}} and clean up all non alpha-numeric characters- Parameters:
r- the rowMap- Returns:
- the interpollated string
-
-