https://www.jianshu.com/p/52cdc402fb5d
带入参数:
@FunctionalInterface
public static interface CustomSelector{
Object select(ResourceInfo availableResource) throws BusinessException;
}
使用
CustomSelector selector = availableResource ->
((StringUtils.isBlank(algorithmInfo.getAlgorithmVersion()) ||
availableResource.getAlgorithmVersion().equals(algorithmInfo.getAlgorithmVersion())) &&
availableResource.getAlgorithmVendor().equals(algorithmInfo.getAlgorithmVendor()));
selector.select(resource.getResourceInfo())