public enum CloudPlatform extends java.lang.Enum<CloudPlatform>
"spring.main.cloud-platform"
configuration property.Enum Constant and Description |
---|
CLOUD_FOUNDRY
Cloud Foundry platform.
|
HEROKU
Heroku platform.
|
KUBERNETES
Kubernetes platform.
|
NONE
No Cloud platform.
|
SAP
SAP Cloud platform.
|
Modifier and Type | Method and Description |
---|---|
static CloudPlatform |
getActive(org.springframework.core.env.Environment environment)
Returns the active
CloudPlatform or null if one is not active. |
boolean |
isActive(org.springframework.core.env.Environment environment)
Determines if the platform is active (i.e.
|
abstract boolean |
isDetected(org.springframework.core.env.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(org.springframework.core.env.Environment environment)
Determines if the platform is enforced by looking at the
"spring.main.cloud-platform" configuration property. |
boolean |
isUsingForwardHeaders()
Returns if the platform is behind a load balancer and uses
X-Forwarded-For headers.
|
static CloudPlatform |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CloudPlatform[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CloudPlatform NONE
public static final CloudPlatform CLOUD_FOUNDRY
public static final CloudPlatform HEROKU
public static final CloudPlatform SAP
public static final CloudPlatform KUBERNETES
public static CloudPlatform[] values()
for (CloudPlatform c : CloudPlatform.values()) System.out.println(c);
public static CloudPlatform valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isActive(org.springframework.core.env.Environment environment)
environment
- the environmentpublic boolean isEnforced(org.springframework.core.env.Environment environment)
"spring.main.cloud-platform"
configuration property.environment
- the environmentpublic boolean isEnforced(Binder binder)
"spring.main.cloud-platform"
configuration property.binder
- the binderpublic abstract boolean isDetected(org.springframework.core.env.Environment environment)
environment
- the environmentpublic boolean isUsingForwardHeaders()
public static CloudPlatform getActive(org.springframework.core.env.Environment environment)
CloudPlatform
or null
if one is not active.environment
- the environmentCloudPlatform
or null