类 ForestConfiguration

java.lang.Object
com.dtflys.forest.config.ForestConfiguration
所有已实现的接口:
Serializable

public class ForestConfiguration extends Object implements Serializable
global configuration Forest全局配置管理类
从以下版本开始:
2016-03-24
作者:
gongjun[dt_flys@hotmail.com]
另请参阅:
  • 方法详细资料

    • getDefaultConfiguration

      public static ForestConfiguration getDefaultConfiguration()
    • configuration

      public static ForestConfiguration configuration()
      实例化ForestConfiguration对象,并初始化默认值
      返回:
      新创建的ForestConfiguration实例
    • configuration

      public static ForestConfiguration configuration(String id)
      实例化ForestConfiguration对象,并初始化默认值
      参数:
      id - 配置ID
      返回:
      新创建的ForestConfiguration实例
    • createConfiguration

      public static ForestConfiguration createConfiguration()
    • allConfigurations

      public List<ForestConfiguration> allConfigurations()
      获取所有定义过的 Forest 配置信息
      返回:
      Forest 配置信息列表
    • getInstanceCache

      public Map<Class,Object> getInstanceCache()
      获取请求接口实例缓存,返回的缓存对象集合用于缓存请求接口的动态代理的实例
      返回:
      缓存对象集合
    • getBackendSelector

      public HttpBackendSelector getBackendSelector()
      获取Forest后端框架选择器
      返回:
      Forest后端框架选择器
    • setBackend

      public ForestConfiguration setBackend(HttpBackend backend)
      设置HTTP后端
      参数:
      backend - HTTP后端对象
      返回:
      当前ForestConfiguration实例
    • setBackendName

      public ForestConfiguration setBackendName(String backendName)
      设置HTTP后端名称
      参数:
      backendName - HTTP后端名称
      返回:
      当前ForestConfiguration实例
    • getBackendName

      public String getBackendName()
      获取HTTP后端名称
      返回:
      HTTP后端名称
    • getBackend

      public HttpBackend getBackend()
      获取当前HTTP后端
      返回:
      当前HTTP后端
    • getAllCreatedBackends

      public Map<String,HttpBackend> getAllCreatedBackends()
      获取所有已创建的Forest后端框架
      返回:
      Map实例,Key: 后端框架名称, Value: HttpBackend接口实例
    • getBackendClientCacheMaxSize

      public Integer getBackendClientCacheMaxSize()
      获取后端客户端对象缓存最大空间大小
      返回:
      后端客户端对象缓存最大空间大小
      从以下版本开始:
      1.5.34
    • setBackendClientCacheMaxSize

      public ForestConfiguration setBackendClientCacheMaxSize(Integer backendClientCacheMaxSize)
      设置后端客户端对象缓存最大空间大小
      参数:
      backendClientCacheMaxSize - 后端客户端对象缓存最大空间大小
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.34
    • getBackendClientCacheExpireTime

      public Duration getBackendClientCacheExpireTime()
      获取后端客户端对象缓存过期时间
      返回:
      后端客户端对象缓存过期时间
      从以下版本开始:
      1.5.35
    • setBackendClientCacheExpireTime

      public ForestConfiguration setBackendClientCacheExpireTime(Duration backendClientCacheExpireTime)
      设置获取后端客户端对象缓存过期时间
      参数:
      backendClientCacheExpireTime - 后端客户端对象缓存过期时间
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.35
    • getForestObjectFactory

      public ForestObjectFactory getForestObjectFactory()
      获取Forest对象实例化工厂
      返回:
      Forest对象实例化工厂对象
    • getForestObject

      public <T> T getForestObject(Class<T> clazz)
      获取Forest接口对象

      适用于Forest相关接口(非请求客户端接口)和回调函数的工厂接口

      当这些类没有实例的情况下,会先实例化并缓存下来,以后再取会通过缓存获取对象

      类型参数:
      T - Forest对象接口类泛型
      参数:
      clazz - Forest对象接口类
      返回:
      Forest对象实例
    • setForestObjectFactory

      public ForestConfiguration setForestObjectFactory(ForestObjectFactory forestObjectFactory)
      设置Forest对象实例化工厂
      参数:
      forestObjectFactory - Forest对象实例化工厂对象
      返回:
      当前ForestConfiguration实例
    • getInterceptorFactory

      public InterceptorFactory getInterceptorFactory()
      获取拦截器工厂
      返回:
      拦截器工厂
    • setInterceptorFactory

      public ForestConfiguration setInterceptorFactory(InterceptorFactory interceptorFactory)
      设置拦截器工厂
      参数:
      interceptorFactory - 拦截器工厂
      返回:
      当前ForestConfiguration实例
    • getProperties

      public ForestProperties getProperties()
      获取Properties配置属性
      返回:
      ForestProperties类实例
    • setProperties

      public ForestConfiguration setProperties(ForestProperties properties)
      设置Properties配置属性
      参数:
      properties - ForestProperties类实例
      返回:
      当前ForestConfiguration实例
    • setHttpBackendSelector

      public ForestConfiguration setHttpBackendSelector(HttpBackendSelector httpBackendSelector)
      设置HTTP后端选择器
      参数:
      httpBackendSelector - HTTP后端选择器
      返回:
      当前ForestConfiguration实例
    • getId

      public String getId()
      获取全局配置ID
      返回:
      全局配置ID
    • getMaxConnections

      public Integer getMaxConnections()
      获取全局的最大连接数
      返回:
      最大连接数
    • setMaxConnections

      public ForestConfiguration setMaxConnections(Integer maxConnections)
      设置全局的最大连接数
      参数:
      maxConnections - 全局的最大连接数
      返回:
      当前ForestConfiguration实例
    • getMaxRouteConnections

      public Integer getMaxRouteConnections()
      获取全局的最大请求路径连接数
      返回:
      最大请求路径连接数
    • setMaxRouteConnections

      public ForestConfiguration setMaxRouteConnections(Integer maxRouteConnections)
      设置全局的最大请求路径连接数
      参数:
      maxRouteConnections - 最大请求路径连接数
      返回:
      当前ForestConfiguration实例
    • getMaxRequestQueueSize

      public Integer getMaxRequestQueueSize()
      获取全局的最大请求等待队列大小
      返回:
      最大请求等待队列大小
      从以下版本开始:
      1.5.22
    • setMaxRequestQueueSize

      public ForestConfiguration setMaxRequestQueueSize(Integer maxRequestQueueSize)
      设置全局的最大请求等待队列大小
      参数:
      maxRequestQueueSize - 最大请求等待队列大小
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.22
    • getMaxAsyncThreadSize

      public Integer getMaxAsyncThreadSize()
      获取最大异步线程池大小
      返回:
      最大异步线程池大小
    • setMaxAsyncThreadSize

      public ForestConfiguration setMaxAsyncThreadSize(Integer maxAsyncThreadSize)
      设置最大异步线程池大小
      参数:
      maxAsyncThreadSize - 最大异步线程池大小
      返回:
      当前ForestConfiguration实例
    • getAsyncMode

      public ForestAsyncMode getAsyncMode()
      获取异步模式
      返回:
      ForestAsyncMode枚举实例
      从以下版本开始:
      1.5.27
    • setAsyncMode

      public ForestConfiguration setAsyncMode(ForestAsyncMode asyncMode)
      设置异步模式
      参数:
      asyncMode - 异步模式 - ForestAsyncMode枚举实例
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.27
    • getMaxAsyncQueueSize

      public Integer getMaxAsyncQueueSize()
      获取最大异步线程池队列大小
      返回:
      最大异步线程池队列大小
      从以下版本开始:
      1.5.22
    • setMaxAsyncQueueSize

      public ForestConfiguration setMaxAsyncQueueSize(Integer maxAsyncQueueSize)
      设置最大异步线程池队列大小
      参数:
      maxAsyncQueueSize - 最大异步线程池队列大小
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.22
    • isAutoRedirection

      public boolean isAutoRedirection()
      是否自动重定向开关
      返回:
      true: 打开, false: 禁止
    • setAutoRedirection

      public ForestConfiguration setAutoRedirection(boolean autoRedirection)
      /** 设置是否打开自动重定向
      参数:
      autoRedirection - true: 打开, false: 禁止
      返回:
      ForestRequest类实例
    • getTimeout

      @Deprecated public Integer getTimeout()
      已过时。
      获取全局的请求超时时间,单位为毫秒
      返回:
      请求超时时间,单位为毫秒
    • setTimeout

      @Deprecated public ForestConfiguration setTimeout(Integer timeout)
      已过时。
      设置全局的请求超时时间,单位为毫秒
      参数:
      timeout - 请求超时时间,单位为毫秒
      返回:
      当前ForestConfiguration实例
    • getCharset

      public String getCharset()
      获取全局的请求数据字符集
      返回:
      字符集名称
    • setCharset

      public ForestConfiguration setCharset(String charset)
      设置全局的请求数据字符集
      参数:
      charset - 字符集名称
      返回:
      当前ForestConfiguration实例
    • getConnectTimeout

      public Integer getConnectTimeout()
      获取全局的请求连接超时时间,单位为毫秒
      返回:
      连接超时时间,单位为毫秒
    • setConnectTimeout

      public ForestConfiguration setConnectTimeout(Integer connectTimeout)
      设置全局的请求连接超时时间,单位为毫秒
      参数:
      connectTimeout - 连接超时时间,单位为毫秒
      返回:
      当前ForestConfiguration实例
    • setConnectTimeout

      public ForestConfiguration setConnectTimeout(int connectTimeout, TimeUnit timeUnit)
      设置全局的请求连接超时时间
      参数:
      connectTimeout - 连接超时时间, 整数
      timeUnit - 时间单位
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.6
    • setConnectTimeout

      public ForestConfiguration setConnectTimeout(Duration connectTimeout)
      设置全局的请求连接超时时间
      参数:
      connectTimeout - 连接超时时间, Duration对象
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.6
    • getReadTimeout

      public Integer getReadTimeout()
      获取全局的请求读取超时时间,单位为毫秒
      返回:
      读取超时时间
      从以下版本开始:
      1.5.6
    • setReadTimeout

      public ForestConfiguration setReadTimeout(Integer readTimeout)
      设置全局的请求读取超时时间,单位为毫秒
      参数:
      readTimeout - 读取超时时间,单位为毫秒
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.6
    • setReadTimeout

      public ForestConfiguration setReadTimeout(int readTimeout, TimeUnit timeUnit)
      设置全局的请求读取超时时间
      参数:
      readTimeout - 读取超时时间
      timeUnit - 时间单位
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.6
    • setReadTimeout

      public ForestConfiguration setReadTimeout(Duration readTimeout)
      设置全局的请求读取超时时间
      参数:
      readTimeout - 读取超时时间, Duration
      返回:
      当前ForestConfiguration实例
      从以下版本开始:
      1.5.6
    • getRetryer

      public Class getRetryer()
      获取全局的请求失败重试策略类
      返回:
      重试策略类
    • setRetryer

      public ForestConfiguration setRetryer(Class retryer)
      设置全局的请求失败重试策略类
      参数:
      retryer - 重试策略类
      返回:
      当前ForestConfiguration实例
    • getRetryCount

      @Deprecated public Integer getRetryCount()
      已过时。
      获取全局的最大请求失败重试次数
      返回:
      重试次数
    • setRetryCount

      @Deprecated public ForestConfiguration setRetryCount(Integer retryCount)
      已过时。
      设置全局的最大请求失败重试次数
      参数:
      retryCount - 重试次数
      返回:
      当前ForestConfiguration实例
    • getMaxRetryCount

      public Integer getMaxRetryCount()
      获取全局的最大请求失败重试次数
      返回:
      重试次数
    • setMaxRetryCount

      public ForestConfiguration setMaxRetryCount(Integer maxRetryCount)
      设置全局的最大请求失败重试次数
      参数:
      maxRetryCount - 最大重试次数
      返回:
      当前ForestConfiguration实例
    • getMaxRetryInterval

      public long getMaxRetryInterval()
      获取全局的最大请求重试之间的时间间隔,单位为毫秒
      返回:
      最大请求重试之间的时间间隔
    • setMaxRetryInterval

      public ForestConfiguration setMaxRetryInterval(long maxRetryInterval)
      设置全局的最大请求重试之间的时间间隔,单位为毫秒
      参数:
      maxRetryInterval - 最大请求重试之间的时间间隔
      返回:
      当前ForestConfiguration实例
    • getBaseAddress

      public ForestAddress getBaseAddress()
      获取全局默认地址(主机名/域名/ip地址 + 端口号)
      返回:
      全局默认地址 ForestAddress对象
    • setBaseAddress

      public ForestConfiguration setBaseAddress(ForestAddress baseAddress)
      设置全局默认地址(主机名/域名/ip地址 + 端口号)
      参数:
      baseAddress - 全局默认地址 ForestAddress对象
      返回:
      当前ForestConfiguration实例
    • setBaseAddressScheme

      public ForestConfiguration setBaseAddressScheme(String scheme)
      设置全局地址的HTTP协议头
      参数:
      scheme - HTTP 协议头
      返回:
      当前ForestConfiguration实例
    • setBaseAddressHost

      public ForestConfiguration setBaseAddressHost(String host)
      设置全局地址的 host
      参数:
      host - 全局地址的主机名/ip地址
      返回:
      当前ForestConfiguration实例
    • setBaseAddressPort

      public ForestConfiguration setBaseAddressPort(Integer port)
      设置全局地址的 port
      参数:
      port - 全局地址的端口号
      返回:
      当前ForestConfiguration实例
    • getBaseAddressSource

      public AddressSource getBaseAddressSource()
      获取全局默认的主机地址信息动态来源
      返回:
      AddressSource接口实例
    • setBaseAddressSourceClass

      public ForestConfiguration setBaseAddressSourceClass(Class<? extends AddressSource> baseAddressSourceClass)
      设置全局默认的主机地址信息动态来源接口实现类
      参数:
      baseAddressSourceClass - AddressSource接口实现类
      返回:
      当前ForestConfiguration实例
    • getSslProtocol

      public String getSslProtocol()
      获取全局的单向HTTPS请求的SSL协议,默认为 TLSv1.2
      返回:
      SSL协议名称
    • setSslProtocol

      public ForestConfiguration setSslProtocol(String sslProtocol)
      设置全局的单向HTTPS请求的SSL协议
      参数:
      sslProtocol - SSL协议名称
      返回:
      当前ForestConfiguration实例
    • isLogEnabled

      public boolean isLogEnabled()
      是否允许打印请求日志
      返回:
      允许为 true , 否则为 false
    • setLogEnabled

      public ForestConfiguration setLogEnabled(boolean logEnabled)
      设置是否允许打印请求日志
      参数:
      logEnabled - 允许为 true , 否则为 false
      返回:
      当前ForestConfiguration实例
    • isLogRequest

      public boolean isLogRequest()
      是否允许打印请求/响应日志
      返回:
      允许为 true, 否则为 false
    • setLogRequest

      public ForestConfiguration setLogRequest(boolean logRequest)
      设置是否允许打印请求/响应日志
      参数:
      logRequest - 允许为 true , 否则为 false
      返回:
      当前ForestConfiguration实例
    • isLogResponseStatus

      public boolean isLogResponseStatus()
      是否允许打印响应日志
      返回:
      允许为 true, 否则为 false
    • setLogResponseStatus

      public ForestConfiguration setLogResponseStatus(boolean logResponseStatus)
      设置是否允许打印响应日志
      参数:
      logResponseStatus - 允许为 true, 否则为 false
      返回:
      当前ForestConfiguration实例
    • isLogResponseContent

      public boolean isLogResponseContent()
      是否允许打印响应日志
      返回:
      允许为 true, 否则为 false
    • setLogResponseContent

      public ForestConfiguration setLogResponseContent(boolean logResponseContent)
      设置是否允许打印响应日志
      参数:
      logResponseContent - 允许为 true, 否则为 false
      返回:
      当前ForestConfiguration实例
    • getLogHandler

      public ForestLogHandler getLogHandler()
      获取日志处理器
      返回:
      日志处理器接口实例
    • setLogHandler

      public ForestConfiguration setLogHandler(ForestLogHandler logHandler)
      设置日志处理器
      参数:
      logHandler - 日志处理器接口实例
      返回:
      当前ForestConfiguration实例
    • isCacheEnabled

      public boolean isCacheEnabled()
      是否缓存请求接口实例
      返回:
      如果允许缓存实例为 true, 否则为 false
    • setCacheEnabled

      public ForestConfiguration setCacheEnabled(boolean cacheEnabled)
      设置是否缓存请求接口实例
      参数:
      cacheEnabled - 如果允许缓存实例为 true, 否则为 false
      返回:
      当前ForestConfiguration实例
    • getDefaultParameters

      public List<RequestNameValue> getDefaultParameters()
      获取全局默认请求参数列表
      返回:
      RequestNameValue 对象列表
    • setDefaultParameters

      public ForestConfiguration setDefaultParameters(List<RequestNameValue> defaultParameters)
      设置全局默认请求参数列表
      参数:
      defaultParameters - 请求参数列表
      返回:
      当前ForestConfiguration实例
    • getDefaultHeaders

      public List<RequestNameValue> getDefaultHeaders()
      获取全局默认请求头信息列表
      返回:
      RequestNameValue 对象列表
    • setDefaultHeaders

      public ForestConfiguration setDefaultHeaders(List<RequestNameValue> defaultHeaders)
      设置全局默认请求头信息列表
      参数:
      defaultHeaders - 请求头信息列表
      返回:
      当前ForestConfiguration实例
    • getAsyncRejectPolicy

      public RejectedExecutionHandler getAsyncRejectPolicy()
    • getAsyncRejectPolicyClass

      public Class<? extends RejectedExecutionHandler> getAsyncRejectPolicyClass()
      获取异步线程池拒绝策略类型
      返回:
      Class实例
    • setAsyncRejectPolicyClass

      public ForestConfiguration setAsyncRejectPolicyClass(Class<? extends RejectedExecutionHandler> asyncRejectPolicyClass)
      设置异步线程池拒绝策略类型
      参数:
      asyncRejectPolicyClass - Class实例
      返回:
      当前ForestConfiguration实例
    • getRetryWhen

      public RetryWhen getRetryWhen()
      获取全局重试条件回调函数
      返回:
      重试条件回调函数 RetryWhen 实例
    • setRetryWhenClass

      public ForestConfiguration setRetryWhenClass(Class<? extends RetryWhen> retryWhenClass)
      设置全局重试条件回调函数
      参数:
      retryWhenClass - RetryWhen接口实现类
      返回:
      当前ForestConfiguration实例
    • getSuccessWhen

      public SuccessWhen getSuccessWhen()
      获取全局请求成功条件回调函数
      返回:
      SuccessWhen接口实例
    • setSuccessWhenClass

      public ForestConfiguration setSuccessWhenClass(Class<? extends SuccessWhen> successWhenClass)
      设置全局请求成功条件回调函数
      参数:
      successWhenClass - SuccessWhen接口实现类
      返回:
      当前ForestConfiguration实例
    • getInterceptors

      public List<Class<? extends Interceptor>> getInterceptors()
      获取全局拦截器列表
      返回:
      Class 实例列表
    • setInterceptors

      public ForestConfiguration setInterceptors(List<Class<? extends Interceptor>> interceptors)
      设置全局拦截器列表
      参数:
      interceptors - 全局拦截器列表
      返回:
      当前ForestConfiguration实例
    • setJsonConverter

      public ForestConfiguration setJsonConverter(ForestJsonConverter converter)
      设置全局JSON数据转换器
      参数:
      converter - JSON数据转换器
      返回:
      当前ForestConfiguration实例
    • getJsonConverter

      public ForestJsonConverter getJsonConverter()
      获取当前全局JSON数据转换器
      返回:
      JSON数据转换器
    • setXmlConverter

      public ForestConfiguration setXmlConverter(ForestXmlConverter converter)
      设置全局XML数据转换器
      参数:
      converter - XML数据转换器
      返回:
      当前ForestConfiguration实例
    • getXmlConverter

      public ForestXmlConverter getXmlConverter()
      获取当前全局XML数据转换器
      返回:
      XML数据转换器
    • setProtobufConverter

      public ForestConfiguration setProtobufConverter(ForestProtobufConverter converter)
      设置全局XML数据转换器
      参数:
      converter - XML数据转换器
      返回:
      当前ForestConfiguration实例
    • getProtobufConverter

      public ForestProtobufConverter getProtobufConverter()
      获取当前全局XML数据转换器
      返回:
      XML数据转换器
    • getProxyFactory

      public <T> ProxyFactory<T> getProxyFactory(Class<T> clazz)
      根据请求接口类创建并获取请求接口的动态代理工厂
      类型参数:
      T - 请求接口类泛型
      参数:
      clazz - 请求接口类
      返回:
      动态代理工厂
    • setVariableValue

      public ForestConfiguration setVariableValue(String name, Object value)
      设置全局变量
      参数:
      name - 变量名
      value - 变量值
      返回:
      当前ForestConfiguration实例
    • setVariableValue

      public ForestConfiguration setVariableValue(String name, ForestVariableValue value)
      设置全局变量
      参数:
      name - 变量名
      value - ForestVariableValue类型变量值
      返回:
      当前ForestConfiguration实例
    • getVariableValue

      public Object getVariableValue(String name)
      根据变量名获取全局变量值
      参数:
      name - 变量名
      返回:
      变量值
    • getVariableValue

      public Object getVariableValue(String name, ForestMethod method)
    • isVariableDefined

      public boolean isVariableDefined(String name)
      判断变量是否已定义
      参数:
      name - 变量名
      返回:
      true: 已定义, false: 未定义
    • getSslKeyStores

      public Map<String,SSLKeyStore> getSslKeyStores()
      获取全局SSL的Key Store表
      返回:
      SSL的Key Store表
    • setSslKeyStores

      public ForestConfiguration setSslKeyStores(Map<String,SSLKeyStore> sslKeyStores)
      设置全局SSL的Key Store表
      参数:
      sslKeyStores - SSL的Key Store表
      返回:
      当前ForestConfiguration实例
    • getPool

      public ForestRequestPool getPool()
      获取全局请求池
      返回:
      Forest请求池
    • setPool

      public void setPool(ForestRequestPool pool)
      设置全局请求池
      参数:
      pool - Forest请求池
    • getBackendClientCache

      public ForestCache<String,Object> getBackendClientCache()
      获取后端客户端对象缓存
      返回:
      后端客户端对象缓存
      从以下版本开始:
      1.5.34
    • getBackendClient

      public <T> T getBackendClient(String key)
      从缓存中获取后端客户端对象
      类型参数:
      T - 后端客户端对象类型
      参数:
      key - 缓存的Key
      返回:
      后端客户端对象
    • putBackendClientToCache

      public void putBackendClientToCache(String key, Object client)
      缓存后端客户端对象
      参数:
      key - 缓存的Key
      client - 后端客户端对象
    • registerKeyStore

      public ForestConfiguration registerKeyStore(SSLKeyStore keyStore)
      注册全局SSL的Key Store信息
      参数:
      keyStore - Key Store信息
      返回:
      当前ForestConfiguration实例
    • getKeyStore

      public SSLKeyStore getKeyStore(String id)
      根据ID获取全局SSL的Key Store信息
      参数:
      id - Key Store的ID
      返回:
      SSLKeyStore 实例
    • getConverter

      public ForestConverter getConverter(ForestDataType dataType)
      根据请求响应数据类型获取数据转换器
      参数:
      dataType - 请求响应数据类型
      返回:
      数据转换器
    • getConverterMap

      public Map<ForestDataType,ForestConverter> getConverterMap()
      获取全局数据转换器表
      返回:
      数据转换器表
    • setConverterMap

      public ForestConfiguration setConverterMap(Map<ForestDataType,ForestConverter> converterMap)
      设置全局数据转换器表
      参数:
      converterMap - 数据转换器表
      返回:
      当前ForestConfiguration实例
    • setToMergeConverterMap

      public ForestConfiguration setToMergeConverterMap(Map<ForestDataType,ForestConverter> converterMap)
      设置合并全局数据转换器表,但不会覆盖整个转换器表
      参数:
      converterMap - 数据转换器表
      返回:
      当前ForestConfiguration实例
    • getVariables

      public Map<String,ForestVariableValue> getVariables()
      获取全局变量表
      返回:
      全局变量表
    • addAllVariables

      public ForestConfiguration addAllVariables(Map<String,Object> variables)
      设置全局变量表
      参数:
      variables - 变量表
      返回:
      当前ForestConfiguration实例
    • setVariables

      public ForestConfiguration setVariables(Map<String,Object> variables)
      替换整个全局变量表
      参数:
      variables - 新变量值表
      返回:
      ForestConfiguration实例
    • createInstance

      public <T> T createInstance(Class<T> clazz)
      创建请求接口的动态代理实例
      类型参数:
      T - 请求接口类泛型
      参数:
      clazz - 请求接口类
      返回:
      动态代理实例
      另请参阅:
    • client

      public <T> T client(Class<T> clazz)
      创建请求接口的动态代理实例
      类型参数:
      T - 请求接口类泛型
      参数:
      clazz - 请求接口类
      返回:
      动态代理实例
    • registerFilter

      public ForestConfiguration registerFilter(String name, Class filterClass)
      注册全局过滤器
      参数:
      name - 过滤器名称
      filterClass - 过滤器类
      返回:
      当前ForestConfiguration实例
    • getRegisteredFilterNames

      public List<String> getRegisteredFilterNames()
      获取全局过滤器注册表中所有过滤器的名称列表
      返回:
      过滤器的名称列表
    • hasFilter

      public boolean hasFilter(String name)
      判断全局过滤器注册表是否已存在某个过滤器
      参数:
      name - 过滤器名称
      返回:
      如果存在为 true, 否则为 false
    • newFilterInstance

      public Filter newFilterInstance(String name)
      根据过滤器名称创建新的过滤器实例
      参数:
      name - 过滤器名称
      返回:
      新的Filter实例
    • request

      public ForestRequest<?> request()
      创建通用 ForestRequest 对象
      返回:
      ForestRequest 对象
    • request

      public <R> ForestRequest<R> request(Class<R> clazz)
      创建通用 ForestRequest 对象
      类型参数:
      R - 返回结果类型泛型参数
      参数:
      clazz - 返回结果类型
      返回:
      ForestRequest 对象
    • get

      public ForestRequest<?> get(String url)
      创建 GET 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • post

      public ForestRequest<?> post(String url)
      创建 POST 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • put

      public ForestRequest<?> put(String url)
      创建 PUT 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • delete

      public ForestRequest<?> delete(String url)
      创建 DELETE 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • head

      public ForestRequest<?> head(String url)
      创建 HEAD 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • patch

      public ForestRequest<?> patch(String url)
      创建 PATCH 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • options

      public ForestRequest<?> options(String url)
      创建 OPTIONS 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象
    • trace

      public ForestRequest<?> trace(String url)
      创建 TRACE 请求的 ForestRequest 对象
      参数:
      url - 请求 URL
      返回:
      ForestRequest 对象