This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public APricePolicy implements PricePolicy { | |
@OOverride | |
public void apply(PolicyInfo policyInfo) { | |
// implements logic.. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* How to Replace Many if Statements in Java(https://www.baeldung.com/java-replace-if-statements) | |
* - 3.4. Rule Engine 적용버전 | |
*/ | |
public interface Policy<T, R> { | |
boolean evaluate(T t, PolicyConditions policyConditions); | |
R apply(T t, PolicyConditions policyConditions); | |
} |