获取List对象获取对象等于某值的对象

        Optional<CompanyInvestorVO> first = investorVOList.stream().filter(item -> item.getInvestorName().equals("张三")).findFirst();
        String investoRatio = first.get().getInvestoRatio();

获取List对象中 属性为值为张三的对象 

发布了15 篇原创文章 · 获赞 1 · 访问量 7360

猜你喜欢

转载自blog.csdn.net/broke_dr/article/details/103598458