枚举类 CloudPlatform
- 所有已实现的接口:
Serializable
,Comparable<CloudPlatform>
,Constable
Simple detection for well known cloud platforms. Detection can be forced using the
"spring.main.cloud-platform"
configuration property.- 从以下版本开始:
- 1.3.0
- 作者:
- Phillip Webb, Brian Clozel, Nguyen Sach
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
枚举常量概要
枚举常量枚举常量说明Azure App Service platform.Cloud Foundry platform.Heroku platform.Kubernetes platform.Nomad platform.No Cloud platform.SAP Cloud platform. -
方法概要
修饰符和类型方法说明static CloudPlatform
getActive
(Environment environment) Returns the activeCloudPlatform
ornull
if one is not active.boolean
isActive
(Environment environment) Determines if the platform is active (i.e. the application is running in it).abstract boolean
isDetected
(Environment environment) Determines if the platform is detected by looking for platform-specific environment variables.boolean
isEnforced
(Binder binder) Determines if the platform is enforced by looking at the"spring.main.cloud-platform"
configuration property.boolean
isEnforced
(Environment environment) Determines if the platform is enforced by looking at the"spring.main.cloud-platform"
configuration property.boolean
Returns if the platform is behind a load balancer and uses X-Forwarded-For headers.static CloudPlatform
返回带有指定名称的该类的枚举常量。static CloudPlatform[]
values()
返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
-
枚举常量详细资料
-
NONE
No Cloud platform. Useful when false-positives are detected. -
CLOUD_FOUNDRY
Cloud Foundry platform. -
HEROKU
Heroku platform. -
SAP
SAP Cloud platform. -
NOMAD
Nomad platform.- 从以下版本开始:
- 3.1.0
-
KUBERNETES
Kubernetes platform. -
AZURE_APP_SERVICE
Azure App Service platform.
-
-
方法详细资料
-
values
返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同- 返回:
- 包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
-
valueOf
返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name
- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException
- 如果该枚举类没有带有指定名称的常量NullPointerException
- 如果参数为空值
-
isActive
Determines if the platform is active (i.e. the application is running in it).- 参数:
environment
- the environment- 返回:
- if the platform is active.
-
isEnforced
Determines if the platform is enforced by looking at the"spring.main.cloud-platform"
configuration property.- 参数:
environment
- the environment- 返回:
- if the platform is enforced
- 从以下版本开始:
- 2.3.0
-
isEnforced
Determines if the platform is enforced by looking at the"spring.main.cloud-platform"
configuration property.- 参数:
binder
- the binder- 返回:
- if the platform is enforced
- 从以下版本开始:
- 2.4.0
-
isDetected
Determines if the platform is detected by looking for platform-specific environment variables.- 参数:
environment
- the environment- 返回:
- if the platform is auto-detected.
- 从以下版本开始:
- 2.3.0
-
isUsingForwardHeaders
public boolean isUsingForwardHeaders()Returns if the platform is behind a load balancer and uses X-Forwarded-For headers.- 返回:
- if X-Forwarded-For headers are used
-
getActive
Returns the activeCloudPlatform
ornull
if one is not active.- 参数:
environment
- the environment- 返回:
- the
CloudPlatform
ornull
-