Skip to content

Instantly share code, notes, and snippets.

View wooklab's full-sized avatar

Hwang In-wook wooklab

View GitHub Profile
@wooklab
wooklab / Policy.java
Last active January 8, 2021 14:55
How to Replace Many if Statements in Java 에서 3.4. Rule Engine 적용버전
/**
* 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);
}
@wooklab
wooklab / APricePolicy.java
Created August 4, 2021 04:08
EnumBeanFactory for using beans of the same type.
public APricePolicy implements PricePolicy {
@OOverride
public void apply(PolicyInfo policyInfo) {
// implements logic..
}
}