类 PropertyFactory


  • public class PropertyFactory
    extends Object
    Used to configure the Taskflow workers using properties.
    从以下版本开始:
    2024-09-01
    作者:
    SHOUSHEN.LUAN
    • 构造器详细资料

      • PropertyFactory

        public PropertyFactory()
    • 方法详细资料

      • enabledSpringEnv

        public static void enabledSpringEnv()
      • getBooleanWithFallback

        public static boolean getBooleanWithFallback​(String workerName,
                                                     String property,
                                                     String fallbackName,
                                                     boolean defaultValue)
        获取指定属性的布尔值,支持回退值。 首先尝试从指定的 workerName 中获取属性值,如果未找到,则使用回退名称进行尝试。 如果仍然未找到,则返回默认值。
        参数:
        workerName - 指定的 worker 名称
        property - 要获取的属性名称
        fallbackName - 回退使用的名称
        defaultValue - 默认值,如果所有尝试都失败则返回此值
        返回:
        属性对应的布尔值
      • getStringWithFallback

        public static String getStringWithFallback​(String workerName,
                                                   String property,
                                                   String fallbackName,
                                                   String defaultValue)