|
|
|
@ -95,6 +95,25 @@ public interface Environment extends PropertyResolver { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
String[] getDefaultProfiles(); |
|
|
|
String[] getDefaultProfiles(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Determine whether one of the given profile expressions matches the |
|
|
|
|
|
|
|
* {@linkplain #getActiveProfiles() active profiles} — or in the case |
|
|
|
|
|
|
|
* of no explicit active profiles, whether one of the given profile expressions |
|
|
|
|
|
|
|
* matches the {@linkplain #getDefaultProfiles() default profiles}. |
|
|
|
|
|
|
|
* <p>Profile expressions allow for complex, boolean profile logic to be |
|
|
|
|
|
|
|
* expressed — for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"}, |
|
|
|
|
|
|
|
* etc. See {@link Profiles#of(String...)} for details on the supported |
|
|
|
|
|
|
|
* expression syntax. |
|
|
|
|
|
|
|
* <p>This method is a convenient shortcut for |
|
|
|
|
|
|
|
* {@code env.acceptsProfiles(Profiles.of(profileExpressions))}. |
|
|
|
|
|
|
|
* @since 5.3.28 |
|
|
|
|
|
|
|
* @see Profiles#of(String...) |
|
|
|
|
|
|
|
* @see #acceptsProfiles(Profiles) |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
default boolean matchesProfiles(String... profileExpressions) { |
|
|
|
|
|
|
|
return acceptsProfiles(Profiles.of(profileExpressions)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Determine whether one or more of the given profiles is active — or |
|
|
|
* Determine whether one or more of the given profiles is active — or |
|
|
|
* in the case of no explicit {@linkplain #getActiveProfiles() active profiles}, |
|
|
|
* in the case of no explicit {@linkplain #getActiveProfiles() active profiles}, |
|
|
|
@ -117,25 +136,6 @@ public interface Environment extends PropertyResolver { |
|
|
|
@Deprecated |
|
|
|
@Deprecated |
|
|
|
boolean acceptsProfiles(String... profiles); |
|
|
|
boolean acceptsProfiles(String... profiles); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Determine whether one of the given profile expressions matches the |
|
|
|
|
|
|
|
* {@linkplain #getActiveProfiles() active profiles} — or in the case |
|
|
|
|
|
|
|
* of no explicit active profiles, whether one of the given profile expressions |
|
|
|
|
|
|
|
* matches the {@linkplain #getDefaultProfiles() default profiles}. |
|
|
|
|
|
|
|
* <p>Profile expressions allow for complex, boolean profile logic to be |
|
|
|
|
|
|
|
* expressed — for example {@code "p1 & p2"}, {@code "(p1 & p2) | p3"}, |
|
|
|
|
|
|
|
* etc. See {@link Profiles#of(String...)} for details on the supported |
|
|
|
|
|
|
|
* expression syntax. |
|
|
|
|
|
|
|
* <p>This method is a convenient shortcut for |
|
|
|
|
|
|
|
* {@code env.acceptsProfiles(Profiles.of(profileExpressions))}. |
|
|
|
|
|
|
|
* @since 5.3.28 |
|
|
|
|
|
|
|
* @see Profiles#of(String...) |
|
|
|
|
|
|
|
* @see #acceptsProfiles(Profiles) |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
default boolean matchesProfiles(String... profileExpressions) { |
|
|
|
|
|
|
|
return acceptsProfiles(Profiles.of(profileExpressions)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Determine whether the given {@link Profiles} predicate matches the |
|
|
|
* Determine whether the given {@link Profiles} predicate matches the |
|
|
|
* {@linkplain #getActiveProfiles() active profiles} — or in the case |
|
|
|
* {@linkplain #getActiveProfiles() active profiles} — or in the case |
|
|
|
|