/** * The entry point to the builder-based optionally typed configuration resolution mechanism. * * String is the default type for configuration entries and is not considered a 'type' by this resolver. Therefore * an UntypedResolver is returned by this method. To convert the configuration value to another type, call * {@link UntypedResolver#as(Class)}. * * @param name The property key to resolve * @return A builder for configuration resolution. */ public static UntypedResolver<String> resolve(String name) { return getConfigProvider().getConfig().resolve(name); }
/** * The entry point to the builder-based optionally typed configuration resolution mechanism. * * String is the default type for configuration entries and is not considered a 'type' by this resolver. Therefore * an UntypedResolver is returned by this method. To convert the configuration value to another type, call * {@link UntypedResolver#as(Class)}. * * @param name The property key to resolve * @return A builder for configuration resolution. */ public static UntypedResolver<String> resolve(String name) { return getConfigProvider().getConfig().resolve(name); }
/** * Resolves the value configured for the given key. * * @param key the property key * * @return the configured property value from the {@link ConfigSource} with the highest ordinal or null if there is * no configured value for it */ public static String getPropertyValue(String key) { return getConfigProvider().getConfig().resolve(key) .evaluateVariables(true) .withCurrentProjectStage(false) .getValue(); }
/** * Resolves the value configured for the given key. * * @param key the property key * * @return the configured property value from the {@link ConfigSource} with the highest ordinal or null if there is * no configured value for it */ public static String getPropertyValue(String key) { return getConfigProvider().getConfig().resolve(key) .evaluateVariables(true) .withCurrentProjectStage(false) .getValue(); }
/** * Resolves the value configured for the given key. * * @param key the property key * @param evaluateVariables whether to evaluate any '${variablename}' variable expressions * * @return the configured property value from the {@link ConfigSource} with the highest ordinal or null if there is * no configured value for it */ public static String getPropertyValue(String key, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
public static String getPropertyValue(String key, String defaultValue, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .withDefault(defaultValue) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
/** * Resolves the value configured for the given key. * * @param key the property key * @param evaluateVariables whether to evaluate any '${variablename}' variable expressions * * @return the configured property value from the {@link ConfigSource} with the highest ordinal or null if there is * no configured value for it */ public static String getPropertyValue(String key, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
public static String getPropertyValue(String key, String defaultValue, boolean evaluateVariables) { return getConfigProvider().getConfig().resolve(key) .withDefault(defaultValue) .evaluateVariables(evaluateVariables) .withCurrentProjectStage(false) .getValue(); }
/** * Resolves the value configured for the given key in the current * {@link org.apache.deltaspike.core.api.projectstage.ProjectStage}. * * <p> * First, it will search for a value configured for the given key suffixed with the current ProjectStage (e.g. * 'myproject.myconfig.Production'), and in case this value is not found (null or empty), it will look up the given * key without any suffix.</p> * * <p> * <b>Attention</b> This method must only be used after all ConfigSources got registered and it also must not be * used to determine the ProjectStage itself.</p> * * @param key * * @return the value configured for {@code <given key>.<current project stage>}, or just the configured value of * {@code <given key>} if the project-stage-specific value is not found (null or empty) * */ public static String getProjectStageAwarePropertyValue(String key) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .evaluateVariables(true) .getValue(); } /**
/** * {@link #getProjectStageAwarePropertyValue(String)} which returns the provided default value if no configured * value can be found (<code>null</code> or empty). * * @param key * @param defaultValue fallback value * * @return the configured value or if non found the defaultValue * */ public static String getProjectStageAwarePropertyValue(String key, String defaultValue) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .withDefault(defaultValue) .evaluateVariables(true) .getValue(); }
/** * {@link #getProjectStageAwarePropertyValue(String)} which returns the provided default value if no configured * value can be found (<code>null</code> or empty). * * @param key * @param defaultValue fallback value * * @return the configured value or if non found the defaultValue * */ public static String getProjectStageAwarePropertyValue(String key, String defaultValue) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .withDefault(defaultValue) .evaluateVariables(true) .getValue(); }
/** * Resolves the value configured for the given key in the current * {@link org.apache.deltaspike.core.api.projectstage.ProjectStage}. * * <p> * First, it will search for a value configured for the given key suffixed with the current ProjectStage (e.g. * 'myproject.myconfig.Production'), and in case this value is not found (null or empty), it will look up the given * key without any suffix.</p> * * <p> * <b>Attention</b> This method must only be used after all ConfigSources got registered and it also must not be * used to determine the ProjectStage itself.</p> * * @param key * * @return the value configured for {@code <given key>.<current project stage>}, or just the configured value of * {@code <given key>} if the project-stage-specific value is not found (null or empty) * */ public static String getProjectStageAwarePropertyValue(String key) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .evaluateVariables(true) .getValue(); } /**
/** * {@link #getPropertyAwarePropertyValue(java.lang.String, java.lang.String)} which returns the provided default * value if no configured value can be found (<code>null</code> or empty). * * <p> * <b>Attention</b> This method must only be used after all ConfigSources got registered and it also must not be * used to determine the ProjectStage itself.</p> * * @param key * @param property the property to look up first and use as the parameter for the main lookup * @param defaultValue fallback value * * @return the configured value or if non found the defaultValue * */ public static String getPropertyAwarePropertyValue(String key, String property, String defaultValue) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .parameterizedBy(property) .withDefault(defaultValue) .evaluateVariables(true) .getValue(); }
/** * {@link #getPropertyAwarePropertyValue(java.lang.String, java.lang.String)} which returns the provided default * value if no configured value can be found (<code>null</code> or empty). * * <p> * <b>Attention</b> This method must only be used after all ConfigSources got registered and it also must not be * used to determine the ProjectStage itself.</p> * * @param key * @param property the property to look up first and use as the parameter for the main lookup * @param defaultValue fallback value * * @return the configured value or if non found the defaultValue * */ public static String getPropertyAwarePropertyValue(String key, String property, String defaultValue) { return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .parameterizedBy(property) .withDefault(defaultValue) .evaluateVariables(true) .getValue(); }
return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .parameterizedBy(property)
return getConfigProvider().getConfig().resolve(key) .withCurrentProjectStage(true) .parameterizedBy(property)