public final class Configuration
extends java.lang.Object
ApiClientImpl
s.
Use Configuration.Builder
or the static factory methods to create instances of
this class.
Modifier and Type | Class and Description |
---|---|
static class |
Configuration.Builder
Builder for
Configuration instances. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTTP_CONFIG_CFG |
static java.lang.String |
STUB_CONFIG_CFG |
Modifier | Constructor and Description |
---|---|
protected |
Configuration(java.util.Map<java.lang.String,java.lang.Object> props)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
getAllProperties() |
<T> T |
getProperty(java.lang.String propName,
java.lang.Class<T> propClass)
Get the value of given configuration property.
|
static Configuration |
newEmptyConfig()
Creates a new empty configuration.
|
static Configuration |
newHttpConfig(HttpConfiguration httpConfig)
Creates a new configuration instance which holds HTTP settings.
|
static Configuration |
newStubConfig(StubConfiguration stubConfig)
Creates a new configuration instance which holds stub configuration.
|
java.util.Set<java.lang.String> |
properties()
Returns the names of all configuration properties registered with this instance.
|
public static final java.lang.String HTTP_CONFIG_CFG
public static final java.lang.String STUB_CONFIG_CFG
protected Configuration(java.util.Map<java.lang.String,java.lang.Object> props)
props
- configuration properties to be registered with this instancepublic java.util.Set<java.lang.String> properties()
public <T> T getProperty(java.lang.String propName, java.lang.Class<T> propClass)
The type of the value must be specified, and the returned reference is of that type.
propName
- name of the property to fetch; must not be null
propClass
- expected type of the property value; must not be null
null
if no
property is registered for propName
java.lang.ClassCastException
- if property is found but its value doesn't match the expected
type specified by propClass
protected java.util.Map<java.lang.String,java.lang.Object> getAllProperties()
public static Configuration newEmptyConfig()
public static Configuration newHttpConfig(HttpConfiguration httpConfig)
httpConfig
- HTTP settings to usepublic static Configuration newStubConfig(StubConfiguration stubConfig)
stubConfig
- stub settings to use