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