File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
core/runtime/src/main/java/io/quarkus/runtime/configuration Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,26 @@ public static SmallRyeConfigBuilder emptyConfigBuilder() {
34
34
.addDefaultSources ();
35
35
}
36
36
37
+ /**
38
+ * Returns a {@code List} of the active profiles in Quarkus.
39
+ * <p>
40
+ * Profiles are sorted in reverse order according to how they were set in
41
+ * {@code quarkus.profile}, as the last profile overrides the previous one until there are
42
+ * no profiles left in the list.
43
+ *
44
+ * @return a {@code List} of the active profiles
45
+ * @see io.smallrye.config.SmallRyeConfig#getProfiles()
46
+ */
37
47
public static List <String > getProfiles () {
38
48
return ConfigProvider .getConfig ().unwrap (SmallRyeConfig .class ).getProfiles ();
39
49
}
40
50
51
+ /**
52
+ * Check if a configuration profile is active in Quarkus.
53
+ *
54
+ * @param profile the configuration profile to check
55
+ * @return true if the profile is active or false otherwise.
56
+ */
41
57
public static boolean isProfileActive (final String profile ) {
42
58
return getProfiles ().contains (profile );
43
59
}
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ Setting `quarkus.profile` to `staging` will activate the `staging` profile.
367
367
368
368
[NOTE]
369
369
====
370
- The `io.smallrye.config.SmallRyeConfig# getProfiles` API provides a way to retrieve the active profiles programmatically.
370
+ The `io.quarkus.runtime.configuration.ConfigUtils. getProfiles` API provides a way to retrieve the active profiles programmatically.
371
371
====
372
372
373
373
=== Profile-aware files
You can’t perform that action at this time.
0 commit comments