Skip to content

Create AllNestedConditions and NoneNestedConditions based on AnyNestedCondition #2400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

efenderbosch
Copy link

I abstracted out the common behavior from AnyNestedCondition to AbstractNestedCondition and created AllNestedConditions and NoneOfNestedConditions and tests.

Basically we need a "all of" condition for something like this:

public class OnSecurityEnabledAndSwaggerEnabled extends AllNestedConditions {

    public OnSecurityEnabledAndSwaggerEnabled() {
        super(ConfigurationPhase.PARSE_CONFIGURATION);
    }

    @ConditionalOnProperty(name = "security.enabled", havingValue = "true")
    static class SecurityEnabled { }

    @ConditionalOnProperty(name = "swagger.enabled", havingValue = "true")
    static class SwaggerEnabled { }

    @Profile(value = { "local", "dev", "qa" })
    static class Profiles { }
}

Adding NoneOf was pretty easy, so I implemented that as well.

Eric Fenderbosch added 2 commits January 22, 2015 14:00
@philwebb philwebb added this to the 1.3.0 milestone Jan 29, 2015
@philwebb philwebb modified the milestones: 1.3.0.M3, 1.3.0.RC1 Aug 5, 2015
@dsyer dsyer self-assigned this Aug 26, 2015
@dsyer dsyer closed this in ea4061f Aug 27, 2015
@philwebb philwebb changed the title Create AllNestedConditions and NoneOfNestedConditions based on AnyNestedCondition Create AllNestedConditions and NoneNestedConditions based on AnyNestedCondition Sep 3, 2015
@nwoike
Copy link

nwoike commented Sep 15, 2015

AllNestedConditions says since 1.2.x. and AnyNestedCondition says since 1.3.x. I think you switched these on accident.

@wilkinsona
Copy link
Member

@nwoike Thank you. I've made the correction in c274162.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants