getActiveProfiles abstract method

List<String> getActiveProfiles()

Active Profiles

Returns the list of explicitly activated profiles for the current runtime environment. These represent the user- or system-defined profile set that determines configuration.

Behavior

  • If profiles were explicitly activated (e.g., via CLI flags, config files, or environment variables), those are returned here.
  • If none are active, getDefaultProfiles provides the fallback.

Example

final profiles = env.getActiveProfiles();
if (profiles.contains('prod')) {
  enableOptimizations();
}

Notes

  • Profile names are case-sensitive unless your environment implementation normalizes them.
  • May return an empty list if nothing is set and no defaults are used.

Implementation

List<String> getActiveProfiles();