Class ParametersService

java.lang.Object
org.tkit.onecx.quarkus.parameter.ParametersService

@ApplicationScoped public class ParametersService extends Object
  • Constructor Details

    • ParametersService

      public ParametersService()
  • Method Details

    • getValue

      public <T> T getValue(String name, Class<T> type, T defaultValue)
      Return the resolved parameter value with the specified type.
      Type Parameters:
      T - The parameter type
      Parameters:
      name - The parameter name
      type - The type into which the resolved parameter value should get converted
      defaultValue - The default parameter value to return if the parameter value could not get resolved
      Returns:
      the resolved parameter value as an instance of the requested type
      Throws:
      UpdateException - if the update of the parameter failed and property onecx.parameters.throw-update-exception is set to true.
      ConvertValueException - if the parameter value cannot be converted to the specified type
      TenantException - if you enable multi-tenancy and ApplicationContext is null.
    • getValue

      public <T> T getValue(String name, Class<T> type)
      Return the resolved parameter value with the specified type.

      This is a shortcut to the getValue(String, Class, Object) method using null as defaultValue.

      Type Parameters:
      T - The parameter type
      Parameters:
      name - The parameter name
      type - The type into which the resolved parameter value should get converted
      Returns:
      the resolved parameter value as an instance of the requested type
      Throws:
      UpdateException - if the update of the parameter failed and property onecx.parameters.throw-update-exception is set to true.
      ConvertValueException - if the parameter value cannot be converted to the specified type
      TenantException - if you enable multi-tenancy and ApplicationContext is null.