Class ConfigurationUtils
- java.lang.Object
-
- org.apache.flink.cdc.common.configuration.ConfigurationUtils
-
public class ConfigurationUtils extends Object
Utility class forConfigurationrelated helper functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanBePrefixMap(ConfigOption<?> configOption)Maps can be represented in two ways.static <E extends Enum<?>>
EconvertToEnum(Object o, Class<E> clazz)static <T> TconvertValue(Object rawValue, Class<?> clazz)Tries to convert the raw value into the provided type.static booleanfilterPrefixMapKey(String key, String candidate)Filter condition for prefix map keys.
-
-
-
Method Detail
-
convertValue
public static <T> T convertValue(Object rawValue, Class<?> clazz)
Tries to convert the raw value into the provided type.- Type Parameters:
T- type of the result- Parameters:
rawValue- rawValue to convert into the provided type clazzclazz- clazz specifying the target type- Returns:
- the converted value if rawValue is of type clazz
- Throws:
IllegalArgumentException- if the rawValue cannot be converted in the specified target type clazz
-
canBePrefixMap
public static boolean canBePrefixMap(ConfigOption<?> configOption)
Maps can be represented in two ways.With constant key space:
avro-confluent.properties = schema: 1, other-prop: 2Or with variable key space (i.e. prefix notation):
avro-confluent.properties.schema = 1 avro-confluent.properties.other-prop = 2
-
-