Category: ‣ 언어, 프레임워크

[JAVA8] IntStream , Lamda 활용

IntStream과 람다식 응용하기 import java.util.Collections; import java.util.List; import java.util.function.IntPredicate; import java.util.stream.Collectors; import java.util.stream.IntStream; class IntStream_Ex { public static void main(String[] args) { IntStream.range(0, 10).forEach((int value) -> System.out.println(value)); System.out.println(“MAX with Lamda:...

[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;...