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

[JAVA 기본Class 해부시리즈] Arrays Class

https://docs.oracle.com/javase/9/docs/api/java/util/Arrays.html java.util.Arrays 배열조작과 관련한 다양한 메서드를 포함하고 있다. AsList 이용하여 특정 문자와 Array비교하기 String[] NotAllowMember = {“Kim”,”Hwang”,”Lee”,”Soo”,”Sung”}; if(Arrays.asList(NotAllowMember).contains(MemberNm)) { // NotAllowMember에 포함시. } Stream API 의 활용 List<String> myList =...