类 EnvironmentUtils

java.lang.Object
com.github.xiaoymin.knife4j.spring.util.EnvironmentUtils

public class EnvironmentUtils extends Object
从以下版本开始:
knife4j 2.0.9
作者:
xiaoymin@foxmail.com 2022/8/18 22:26
  • 构造器详细资料

    • EnvironmentUtils

      public EnvironmentUtils()
  • 方法详细资料

    • resolveContextPath

      public static String resolveContextPath(org.springframework.core.env.Environment environment)
      处理程序contextPath
      参数:
      environment - 环境变量
      返回:
      contextPath
      从以下版本开始:
      v4.4.0
    • resolveString

      public static String resolveString(org.springframework.core.env.Environment environment, String key, String defaultValue)
      get String property
      参数:
      environment - Spring Context Environment
      key - hash-key
      defaultValue - default
      返回:
      属性
    • resolveInt

      public static Integer resolveInt(org.springframework.core.env.Environment environment, String key, Integer defaultValue)
      获取int类型的值
      参数:
      environment - 环境变量
      key - 变量
      defaultValue - 默认值
      返回:
      int属性
    • resolveBool

      public static Boolean resolveBool(org.springframework.core.env.Environment environment, String key, Boolean defaultValue)
      获取bool值
      参数:
      environment - 环境变量
      key - 变量
      defaultValue - 默认值
      返回:
      bool