public class ApplicationProperties extends Specification
| Modifier and Type | Field and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
application
The encapsulated name-value pairs.
|
java.lang.String |
applicationId
The application identifier string.
|
InstanceProperties |
instanceProperties
The properties for the system instance the application is part of.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ApplicationProperties(InstanceProperties instanceProperties,
java.lang.String applicationId)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static ApplicationProperties |
getFor(java.lang.String systemId,
java.lang.String applicationId,
java.io.File secretsDir)
Primary factory method.
|
java.util.Map<java.lang.String,java.lang.Object> |
getRelativeMap(java.lang.String suffix)
Looks up a property value given a property name suffix.
|
java.lang.Object |
getRelativeProperty(java.lang.String suffix)
Looks up a property value given a property name suffix.
|
java.lang.String |
getRelativeString(java.lang.String suffix)
Looks up a string property value given a property name suffix.
|
<T> T |
instantiate(java.lang.String relativeName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameters,
java.lang.String description)
Instantiates the class identified by the relative property.
|
<T> T |
instantiate(java.lang.String relativeName,
java.lang.String description)
Instantiates the class identified by the relative property.
|
<T> T |
invokeFactory(java.lang.String relativeFactory,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameters,
java.lang.String description)
Instantiates an object using the factory method defined as the value of
the application property passed as the
relativeFactory. |
containsKey, convertToMap, convertToMap, get, getBoolean, getBoolean, getInteger, getInteger, getKeys, getString, getString, isEmpty, isFalse, isTrue, loadProperties, loadProperties, loadPropertiesFromFile, loadPropertiesFromFile, loadPropertiesFromList, loadPropertiesFromResource, parseListinggetProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamesclear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsValue, elements, entrySet, equals, forEach, getOrDefault, hashCode, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, valuespublic final InstanceProperties instanceProperties
public final java.lang.String applicationId
public final java.util.Map<java.lang.String,java.lang.Object> application
@Deprecated protected ApplicationProperties(InstanceProperties instanceProperties, java.lang.String applicationId)
instanceProperties - The related instance properties.applicationId - The application identifier.public static ApplicationProperties getFor(java.lang.String systemId, java.lang.String applicationId, java.io.File secretsDir)
systemId - The package that holds the instance properties resourceapplicationId - The application identifiersecretsDir - The directory to start looking for secrets inpublic java.lang.Object getRelativeProperty(java.lang.String suffix)
suffix - The suffix appended to the application properties base.public java.util.Map<java.lang.String,java.lang.Object> getRelativeMap(java.lang.String suffix)
suffix - The suffix appended to the application properties base.public java.lang.String getRelativeString(java.lang.String suffix)
suffix - The suffix appended to the application properties base.public <T> T instantiate(java.lang.String relativeName,
java.lang.String description)
T - The type to instantiate.relativeName - The suffix appended to the application properties base.description - A prefix included in the exception message in case of failure.java.lang.IllegalStateException - If unable to determine the class name.public <T> T instantiate(java.lang.String relativeName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameters,
java.lang.String description)
T - The type to instantiate.relativeName - The suffix appended to the application properties base.parameterTypes - The constructor parameter type array.parameters - The constructor parameters to pass.description - A prefix included in the exception message in case of failure.java.lang.IllegalStateException - If unable to determine the class name.public <T> T invokeFactory(java.lang.String relativeFactory,
java.lang.Class<?>[] parameterTypes,
java.lang.Object[] parameters,
java.lang.String description)
relativeFactory.T - The factory method return typerelativeFactory - The application property that defines the factoryparameterTypes - The parameter types for the factory methodparameters - The parameter objects for the factory methoddescription - The exception message prefix