public class ConfigUtils extends Object
| Constructor and Description |
|---|
ConfigUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getConfiguredClassName(Class<?> type,
Properties configuration,
String... implementationDiscriminatorValues)
Retrieves the class name of the concrete instance of the class with the given type as configured by the given
Configuration. |
static <T extends Configurable> |
getConfiguredInstanceOf(Class<? extends T> type,
Properties configuration,
String... implementationDiscriminatorValues)
Retrieves the concrete instance of the class with the given type as configured by the given
Configuration. |
static <T> T |
getInstanceOf(Class<? extends T> type,
Properties configuration,
String... implementationDiscriminatorValues)
Retrieves the concrete instance of the class with the given type as configured by the given
Configuration. |
public static <T extends Configurable> T getConfiguredInstanceOf(Class<? extends T> type, Properties configuration, String... implementationDiscriminatorValues)
Configuration.
Tries to retrieve a specific implementation first (propery key = fully qualified name of the interface
type + '.impl.className.' + implementationDiscriminatorValue). If this key does not exist, the generally configured
instance is retrieved (same property key without the implementationDiscriminatorValue).type - The type of the instanceconfiguration - The configuration containing the necessary properties for configuring the instanceimplementationDiscriminatorValues - The values that define which specific implementation class should be used.
This is typically an environment specific property, like the DBMS that is used.public static <T> T getInstanceOf(Class<? extends T> type, Properties configuration, String... implementationDiscriminatorValues)
Configuration.
Tries to retrieve a specific implementation first (propery key = fully qualified name of the interface
type + '.impl.className.' + implementationDiscriminatorValue). If this key does not exist, the generally configured
instance is retrieved (same property key without the implementationDiscriminatorValue).type - The type of the instanceconfiguration - The configuration containing the necessary properties for configuring the instanceimplementationDiscriminatorValues - The values that define which specific implementation class should be used.
This is typically an environment specific property, like the DBMS that is used.public static String getConfiguredClassName(Class<?> type, Properties configuration, String... implementationDiscriminatorValues)
Configuration.
Tries to retrieve a specific implementation first (propery key = fully qualified name of the interface
type + '.impl.className.' + implementationDiscriminatorValue). If this key does not exist, the generally configured
instance is retrieved (same property key without the implementationDiscriminatorValue).type - The type of the instanceconfiguration - The configuration containing the necessary properties for configuring the instanceimplementationDiscriminatorValues - The values that define which specific implementation class should be used.
This is typically an environment specific property, like the DBMS that is used.Copyright © 2016. All Rights Reserved.