Adam
Adam

Reputation: 862

Easy-rules: Cannot resolve aNewRulesEngine()

The code below cannot be compiled due to 'cannot find symbol symbol: class aNewRulesEngine location: class org.jeasy.rules.core.RulesEngineBuilder'

However, judging by this tutorial https://github.com/j-easy/easy-rules/wiki/fizz-buzz it should be fine.

Any ideas why does it goes sour?

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.RulesEngineBuilder;

public class Main {

    public static void main(String[] args) {
        RulesEngine rulesEngine = new RulesEngineBuilder.aNewRulesEngine();
    }
}

Upvotes: 1

Views: 478

Answers (1)

Assafs
Assafs

Reputation: 3275

aNewRulesEngine is a static method in RulesEngineBuilder (according to the documentation: https://github.com/j-easy/easy-rules/blob/master/easy-rules-core/src/main/java/org/jeasy/rules/core/RulesEngineBuilder.java) - but in your code sample, you are also trying to instantiate an instance for RulesEngineBuilder.

Perhaps this code will work better:

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.RulesEngineBuilder;

public class Main {

    public static void main(String[] args) {
        RulesEngine rulesEngine = RulesEngineBuilder.aNewRulesEngine();
    }
}

Upvotes: 3

Related Questions