org.apache.kafka.common.config
Class AbstractConfig

java.lang.Object
  extended by org.apache.kafka.common.config.AbstractConfig
Direct Known Subclasses:
ConsumerConfig, ProducerConfig

public class AbstractConfig
extends java.lang.Object

A convenient base class for configurations to extend.

This class holds both the original configuration that was provided as well as the parsed


Constructor Summary
AbstractConfig(ConfigDef definition, java.util.Map<?,?> originals)
           
 
Method Summary
protected  java.lang.Object get(java.lang.String key)
           
 boolean getBoolean(java.lang.String key)
           
 java.lang.Class<?> getClass(java.lang.String key)
           
<T> T
getConfiguredInstance(java.lang.String key, java.lang.Class<T> t)
          Get a configured instance of the give class specified by the given configuration key.
<T> java.util.List<T>
getConfiguredInstances(java.lang.String key, java.lang.Class<T> t)
           
 double getDouble(java.lang.String key)
           
 int getInt(java.lang.String key)
           
 java.util.List<java.lang.String> getList(java.lang.String key)
           
 long getLong(java.lang.String key)
           
 java.lang.String getString(java.lang.String key)
           
 void logUnused()
          Log warnings for any unused configurations
 java.util.Set<java.lang.String> unused()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConfig

public AbstractConfig(ConfigDef definition,
                      java.util.Map<?,?> originals)
Method Detail

get

protected java.lang.Object get(java.lang.String key)

getInt

public int getInt(java.lang.String key)

getLong

public long getLong(java.lang.String key)

getDouble

public double getDouble(java.lang.String key)

getList

public java.util.List<java.lang.String> getList(java.lang.String key)

getBoolean

public boolean getBoolean(java.lang.String key)

getString

public java.lang.String getString(java.lang.String key)

getClass

public java.lang.Class<?> getClass(java.lang.String key)

unused

public java.util.Set<java.lang.String> unused()

logUnused

public void logUnused()
Log warnings for any unused configurations


getConfiguredInstance

public <T> T getConfiguredInstance(java.lang.String key,
                                   java.lang.Class<T> t)
Get a configured instance of the give class specified by the given configuration key. If the object implements Configurable configure it using the configuration.

Parameters:
key - The configuration key for the class
t - The interface the class should implement
Returns:
A configured instance of the class

getConfiguredInstances

public <T> java.util.List<T> getConfiguredInstances(java.lang.String key,
                                                    java.lang.Class<T> t)