简单的代码实例(原有代码只需要根据,代码实例可以改造,添加业务逻辑处理)
public class TestDemo {
public static void main(String[] args){
Map<Integer, BiFunction> hehe = new HashMap<>();
BiFunction<Integer,Integer,Integer> biCount2 = (aa1,aa2) ->{
System.out.println(aa1);
return aa1+aa2;
};
hehe.put(1,biCount2);
hehe.put(4,A());
//============含有if的
//根据前端传入的字段字段if判断,或者switch case
//================去掉if判断==============================
//数据库表的设计 判断标识 描述(case1 case2 case3)
//数据库查询,查出Map集合
//Map.get(remark).apply(1,2); 三个参数均为前端传入
//BI1 BI2 BI3
System.out.println(hehe.get(4).apply(33,44));
}
static BiFunction A(){
BiFunction<Integer,Integer,Integer> bi = (b,c1) ->{
return b+c1;
};
return bi;
}
}