Package com.helixframework.env
Class HelixSpringProfileResolver
java.lang.Object
com.helixframework.env.HelixSpringProfileResolver
Utility class responsible for resolving the current application environment/profile
based on Spring Boot configuration properties, Helix-specific environment configurations,
and corresponding environment variables.
This class provides methods to extract the environment configuration using either
predefined properties or environment variables. It also includes helpers to detect
specific environments like "local" or "default".
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the current environment is set to the default environment.static booleanisLocal()Determines whether the current environment is set to "local".static Stringresolve()Resolves the current environment/profile based on Spring Boot and Helix specific configuration properties and environment variables.
-
Field Details
-
ENV_ENVIRONMENT
Represents the name of the environment variable used to specify the Helix-specific environment. The variable is typically used to override or define the application environment independently of Spring Boot's "spring.profiles.active" configuration. The value of this constant is "HELIX_ENV".- See Also:
-
PROP_ENVIRONMENT
A constant property name used to specify the environment in Helix configurations. This property is typically used to define the environment value (e.g., "dev", "prod", "local"), which can be resolved via either system properties or environment variables. The value associated with this property (`"helix.env"`) acts as a key for looking up the environment configuration in the system property or environment variable scope. This property is considered during the process of resolving the current application environment.- See Also:
-
-
Constructor Details
-
HelixSpringProfileResolver
public HelixSpringProfileResolver()
-
-
Method Details
-
resolve
Resolves the current environment/profile based on Spring Boot and Helix specific configuration properties and environment variables.- Returns:
- The resolved environment name
-
isLocal
public static boolean isLocal()Determines whether the current environment is set to "local".- Returns:
- true if the environment is "local", false otherwise
-
isDefault
public static boolean isDefault()Checks if the current environment is set to the default environment.- Returns:
- true if the current environment is the default environment, false otherwise
-