Package org.tkit.onecx.quarkus.parameter
Class ParametersService
java.lang.Object
org.tkit.onecx.quarkus.parameter.ParametersService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParameters config source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TReturn the resolved property value with the specified type for the specified property name from the underlying configuration sources.<T> TReturn the resolved property value with the specified type for the specified property name from the underlying configuration sources.voidinit(ParametersConfig parametersConfig, String applicationId) Initialize the cache and parameters client
-
Constructor Details
-
ParametersService
public ParametersService()
-
-
Method Details
-
init
Initialize the cache and parameters client- Parameters:
parametersConfig- the parameters management configuration
-
getValue
Return the resolved property value with the specified type for the specified property name from the underlying configuration sources.The configuration value is not guaranteed to be cached by the implementation, and may be expensive to compute; therefore, if the returned value is intended to be frequently used, callers should consider storing rather than recomputing it.
- Type Parameters:
T- The property type- Parameters:
propertyName- The configuration property namepropertyType- The type into which the resolved property value should get converteddefaultValue- The default value to return if the property value could not get resolved- Returns:
- the resolved property value as an instance of the requested type
- Throws:
IllegalArgumentException- if the property cannot be converted to the specified typeNoSuchElementException- if the property isn't present in the configuration
-
getValue
Return the resolved property value with the specified type for the specified property name from the underlying configuration sources.The configuration value is not guaranteed to be cached by the implementation, and may be expensive to compute; therefore, if the returned value is intended to be frequently used, callers should consider storing rather than recomputing it.
This is a shortcut to the
getValuemethod usingnullasdefaultValue.- Type Parameters:
T- The property type- Parameters:
propertyName- The configuration property namepropertyType- The type into which the resolved property value should get converted- Returns:
- the resolved property value as an instance of the requested type
- Throws:
IllegalArgumentException- if the property cannot be converted to the specified typeNoSuchElementException- if the property isn't present in the configuration
-