[GUAVA] Predicate 사용예
<!-- https://mvnrepository.com/artifact/com.google.guava/guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>24.0-jre</version> </dependency>
List<OnlineMenuVO> selectMenu2List = this.uiMainService.selectMenu2List(this.custCoCd); Predicate<OnlineMenuVO> lvl1ListPredicate = new Predicate<OnlineMenuVO>() { @Override public boolean apply(@Nullable OnlineMenuVO onlineMenuVO) { if(onlineMenuVO.getClsLvl() == 1){ return true; } return false; } }; List<OnlineMenuVO> lvl1List = Lists.newArrayList(Iterables.filter(selectMenu2List, lvl1ListPredicate));
최근 댓글