报告可以用方法引用替换的lambda

1、获取对象的属性值

警告截图:

Reports lambdas which can be replaced with method references

解决截图:

Reports lambdas which can be replaced with method references

把lambda表达式x->x.getFplrId()改成相应的“实体类::获取实体类的属性”,如Cfptz::getFplrId

2、使用自定义的函数

警告截图:

Reports lambdas which can be replaced with method references

解决截图:

Reports lambdas which can be replaced with method references

 3、使用集合的函数

警告截图

Reports lambdas which can be replaced with method references

解决截图:

Reports lambdas which can be replaced with method references

 4、Integer类型判空

Reports lambdas which can be replaced with method references

解决截图

a、需要不为空的Integer:

Reports lambdas which can be replaced with method references

b、需要判空的是Objects.isNull()

 

相关文章: