@@ -96,6 +96,25 @@ public interface Environment extends PropertyResolver {
96
96
*/
97
97
String [] getDefaultProfiles ();
98
98
99
+ /**
100
+ * Determine whether one of the given profile expressions matches the
101
+ * {@linkplain #getActiveProfiles() active profiles} — or in the case
102
+ * of no explicit active profiles, whether one of the given profile expressions
103
+ * matches the {@linkplain #getDefaultProfiles() default profiles}.
104
+ * <p>Profile expressions allow for complex, boolean profile logic to be
105
+ * expressed — for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"},
106
+ * etc. See {@link Profiles#of(String...)} for details on the supported
107
+ * expression syntax.
108
+ * <p>This method is a convenient shortcut for
109
+ * {@code env.acceptsProfiles(Profiles.of(profileExpressions))}.
110
+ * @since 5.3.28
111
+ * @see Profiles#of(String...)
112
+ * @see #acceptsProfiles(Profiles)
113
+ */
114
+ default boolean matchesProfiles (String ... profileExpressions ) {
115
+ return acceptsProfiles (Profiles .of (profileExpressions ));
116
+ }
117
+
99
118
/**
100
119
* Determine whether one or more of the given profiles is active — or
101
120
* in the case of no explicit {@linkplain #getActiveProfiles() active profiles},
@@ -118,25 +137,6 @@ public interface Environment extends PropertyResolver {
118
137
@ Deprecated
119
138
boolean acceptsProfiles (String ... profiles );
120
139
121
- /**
122
- * Determine whether one of the given profile expressions matches the
123
- * {@linkplain #getActiveProfiles() active profiles} — or in the case
124
- * of no explicit active profiles, whether one of the given profile expressions
125
- * matches the {@linkplain #getDefaultProfiles() default profiles}.
126
- * <p>Profile expressions allow for complex, boolean profile logic to be
127
- * expressed — for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"},
128
- * etc. See {@link Profiles#of(String...)} for details on the supported
129
- * expression syntax.
130
- * <p>This method is a convenient shortcut for
131
- * {@code env.acceptsProfiles(Profiles.of(profileExpressions))}.
132
- * @since 5.3.28
133
- * @see Profiles#of(String...)
134
- * @see #acceptsProfiles(Profiles)
135
- */
136
- default boolean matchesProfiles (String ... profileExpressions ) {
137
- return acceptsProfiles (Profiles .of (profileExpressions ));
138
- }
139
-
140
140
/**
141
141
* Determine whether the given {@link Profiles} predicate matches the
142
142
* {@linkplain #getActiveProfiles() active profiles} — or in the case
0 commit comments