类 EnvironmentUtils

java.lang.Object
spring.turbo.core.EnvironmentUtils

public final class EnvironmentUtils extends Object
Environment相关工具
从以下版本开始:
1.0.0
作者:
应卓
另请参阅:
  • 方法详细资料

    • resolvePlaceholders

      public static String resolvePlaceholders(String text)
      解析placeholder
      参数:
      text - 解析的文本
      返回:
      解析结果
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
    • resolveRequiredPlaceholders

      public static String resolveRequiredPlaceholders(String text)
      解析placeholder
      参数:
      text - 解析的文本
      返回:
      解析结果
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
      IllegalArgumentException - 任意一个解析项无法满足
    • getPropertyValue

      @Nullable public static String getPropertyValue(String propertyName)
      获取PropertyValue
      参数:
      propertyName - property名
      返回:
      结果或null
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
    • getRequiredPropertyValue

      public static String getRequiredPropertyValue(String propertyName)
      获取PropertyValue
      参数:
      propertyName - property名
      返回:
      结果
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
      IllegalArgumentException - 无法找到property名相对的值
    • getPropertyValue

      @Nullable public static <T> T getPropertyValue(String propertyName, Class<T> targetType)
      获取PropertyValue
      类型参数:
      T - 目标类型泛型
      参数:
      propertyName - property名
      targetType - 目标类型
      返回:
      结果或null
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
    • getRequiredPropertyValue

      public static <T> T getRequiredPropertyValue(String propertyName, Class<T> targetType)
      获取PropertyValue
      类型参数:
      T - 目标类型泛型
      参数:
      propertyName - property名
      targetType - 目标类型
      返回:
      结果
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
      IllegalArgumentException - 无法找到property名相对的值
    • getPropertyValue

      @Nullable public static <T> T getPropertyValue(String propertyName, Class<T> targetType, @Nullable T defaultIfNull)
      获取PropertyValue
      类型参数:
      T - 目标类型泛型
      参数:
      propertyName - property名
      targetType - 目标类型
      defaultIfNull - 默认值
      返回:
      结果或默认值 (可能为null)
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
    • getRequiredPropertyValue

      public static <T> T getRequiredPropertyValue(String propertyName, Class<T> targetType, @Nullable T defaultIfNull)
      获取PropertyValue
      类型参数:
      T - 目标类型泛型
      参数:
      propertyName - property名
      targetType - 目标类型
      defaultIfNull - 默认值
      返回:
      结果或默认值 (可能为null)
      抛出:
      UnsupportedOperationException - 无法定位ApplicationContext实例
      IllegalArgumentException - 无法找到property名相对的值