public enum CloudPlatform extends 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(Environment environment)
Returns the active
CloudPlatform or null if one is not active. |
boolean |
isActive(Environment environment)
Determines if the platform is active (i.e.
|
abstract boolean |
isDetected(Environment environment)
Determines if the platform is detected by looking for platform-specific environment
variables.
|
boolean |
isEnforced(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(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(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isActive(Environment environment)
environment
- the environmentpublic boolean isEnforced(Environment environment)
"spring.main.cloud-platform"
configuration property.environment
- the environmentpublic abstract boolean isDetected(Environment environment)
environment
- the environmentpublic boolean isUsingForwardHeaders()
public static CloudPlatform getActive(Environment environment)
CloudPlatform
or null
if one is not active.environment
- the environmentCloudPlatform
or null