public class ConfigUtils extends Object
| Constructor and Description |
|---|
ConfigUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Charset |
charset(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return a charset for a string key.
|
static List<Charset> |
charsets(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return a charset(s) for a list key.
|
static <T extends Enum<T>> |
enumDescription(Class<T> enumClass,
T... excludes) |
static <T extends Enum<T>> |
enumDescription(Map<T,String> descriptions) |
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 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.
|
static <T extends Enum<T>> |
getEnums(Class<T> enumClass,
org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return enums from a list.
|
static Set<String> |
getSet(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to retrieve a list and convert it to an immutable set.
|
static com.google.common.net.HostAndPort |
hostAndPort(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to parse a string ConfigDef item to a HostAndPort
|
static com.google.common.net.HostAndPort |
hostAndPort(org.apache.kafka.common.config.AbstractConfig config,
String key,
Integer defaultPort)
Method is used to parse a string ConfigDef item to a HostAndPort
|
static List<com.google.common.net.HostAndPort> |
hostAndPorts(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to parse hosts and ports
|
static List<com.google.common.net.HostAndPort> |
hostAndPorts(org.apache.kafka.common.config.AbstractConfig config,
String key,
Integer defaultPort)
Method is used to parse a list ConfigDef item to a list of HostAndPort
|
static InetSocketAddress |
inetSocketAddress(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return an InetSocketAddress from a hostname:port string.
|
static List<InetSocketAddress> |
inetSocketAddresses(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return a list of InetSocketAddress from a config list of hostname:port strings.
|
static KeyManagerFactory |
keyManagerFactory(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method will create a KeyManagerFactory based on the Algorithm type specified in the config.
|
static KeyStore |
keyStore(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method will create a KeyStore based on the KeyStore type specified in the config.
|
static byte[] |
passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return an array of bytes representing the password stored in the config.
|
static byte[] |
passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key,
Charset charset)
Method is used to return an array of bytes representing the password stored in the config.
|
static byte[] |
passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key,
String charset)
Method is used to return an array of bytes representing the password stored in the config.
|
static char[] |
passwordCharArray(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to return an array of characters representing the password stored in the config.
|
static Pattern |
pattern(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to create a pattern based on the config element.
|
static SSLContext |
sslContext(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method will create a SSLContext based on the Algorithm type specified in the config.
|
static TrustManagerFactory |
trustManagerFactory(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method will create a TrustManagerFactory based on the Algorithm type specified in the config.
|
static URI |
uri(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to retrieve a URI from a configuration key.
|
static List<URI> |
uris(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to retrieve a list of URI(s) from a configuration key.
|
static URL |
url(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to retrieve a URL from a configuration key.
|
static List<URL> |
urls(org.apache.kafka.common.config.AbstractConfig config,
String key)
Method is used to retrieve a list of URL(s) from a configuration key.
|
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 valueValidators.validEnum(Class, Enum[])public static <T extends Enum<T>> List<T> getEnums(Class<T> enumClass, org.apache.kafka.common.config.AbstractConfig config, String key)
T - enumClass - config - key - Validators.validEnum(Class, Enum[])public static <T extends Enum<T>> String enumDescription(Class<T> enumClass, T... excludes)
public static <T extends Enum<T>> String enumDescription(Map<T,String> descriptions)
public 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 valuepublic static InetSocketAddress inetSocketAddress(org.apache.kafka.common.config.AbstractConfig config, String key)
config - config to read the value fromkey - key for the valuepublic static List<InetSocketAddress> inetSocketAddresses(org.apache.kafka.common.config.AbstractConfig config, String key)
config - config to read the value fromkey - key for the valuepublic static com.google.common.net.HostAndPort hostAndPort(org.apache.kafka.common.config.AbstractConfig config,
String key,
Integer defaultPort)
config - Config to read fromkey - ConfigItem to get the host string from.defaultPort - The default port to use if a port was not specified. Can be null.public static com.google.common.net.HostAndPort hostAndPort(org.apache.kafka.common.config.AbstractConfig config,
String key)
config - Config to read fromkey - ConfigItem to get the host string from.public static List<com.google.common.net.HostAndPort> hostAndPorts(org.apache.kafka.common.config.AbstractConfig config, String key, Integer defaultPort)
config - Config to read fromkey - ConfigItem to get the host string from.defaultPort - The default port to use if a port was not specified. Can be null.public static List<com.google.common.net.HostAndPort> hostAndPorts(org.apache.kafka.common.config.AbstractConfig config, String key)
config - key - public static URL url(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to readkey - Key to readpublic static List<URL> urls(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to readkey - Key to readpublic static URI uri(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to readkey - Key to readpublic static List<URI> uris(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to readkey - Key to readpublic static Set<String> getSet(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to readkey - Key to readImmutableSetpublic static Pattern pattern(org.apache.kafka.common.config.AbstractConfig config, String key)
config - key - public static byte[] passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key)
config - Config to read fromkey - Key to read frompublic static byte[] passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key,
String charset)
config - Config to read fromkey - Key to read fromcharset - Charset to usepublic static byte[] passwordBytes(org.apache.kafka.common.config.AbstractConfig config,
String key,
Charset charset)
config - Config to read fromkey - Key to read fromcharset - Charset to usepublic static char[] passwordCharArray(org.apache.kafka.common.config.AbstractConfig config,
String key)
config - Config to read fromkey - Key to read frompublic static KeyStore keyStore(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to read from.key - Key to read frompublic static KeyManagerFactory keyManagerFactory(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to read from.key - Key to read frompublic static TrustManagerFactory trustManagerFactory(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to read from.key - Key to read frompublic static SSLContext sslContext(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to read from.key - Key to read frompublic static Charset charset(org.apache.kafka.common.config.AbstractConfig config, String key)
config - Config to read from.key - Key to read fromCopyright © 2016–2025. All rights reserved.