public class ConfigUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
enumValues(Class<?> enumClass)
Method is used to return the values for an enum.
|
static File |
getAbsoluteFile(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return a File checking to ensure that it is an absolute path.
|
static <T> Class<T> |
getClass(org.apache.kafka.common.config.AbstractConfig config,
String key,
Class<T> expected)
Method is used to return a class that should be assignable to the expected class.
|
static <T extends Enum<T>> |
getEnum(Class<T> enumClass,
org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return an enum value from a given string.
|
public static <T> Class<T> getClass(org.apache.kafka.common.config.AbstractConfig config, String key, Class<T> expected)
T - Class type to return.config - config that has the class settingkey - key to readexpected - expected parent class or interfaceIllegalStateException - Thrown if it fails expected.isAssignableFrom(cls).public static <T extends Enum<T>> T getEnum(Class<T> enumClass, org.apache.kafka.common.config.AbstractConfig config, String key)
T - Enum class to return type for.enumClass - Class for the resulting enum valueconfig - config to read the value fromkey - key for the valueValidEnumpublic static String enumValues(Class<?> enumClass)
enumClass - Enum class to return the constants for.public static File getAbsoluteFile(org.apache.kafka.common.config.AbstractConfig config, String key)
config - config to read the value fromkey - key for the valueCopyright © 2016–2017. All rights reserved.