List statisticsList = Arrays.asList(logs) Map groupData = statisticsList.stream() .collect( Collectors.groupingBy(StatisticsVO::getDateTime, Collectors.groupingBy(StatisticsVO::getUserName , Collectors.reducing(0, StatisticsVO::getCount, (int1, int2) -> int1+ int2))));
maven은 dependency 엘리먼트 하위의 scope 엘리먼트를 통해 포함하려는 라이브러리의 범위를 지정할 수 있다. Maven 3에서는 다음의 여섯가지 옵션을 지원하고 있다.compile : 기본 scope이다. 만약 dependency에 아무것도 입력하지 않았다면 기본적으로 입력되는 scope이다. 이 옵션은 프로젝트의 모든 classpath에 추가된다(테스트 중이건 런타임 중이건 상관없이).provided : 이 옵션은 compile과 매우 비슷하지만, 실행시 의존관계를 제공하는 JDK나 Web Container(tomcat 같은)에 대해서 적용된다. 예를 들어 Java Enterprise Edition Web application을 개발할때 Servlet API나 Java EE API들은 "..
String dtString = "12 12 2012";SimpleDateFormat transFormat = new SimpleDateFormat("dd MM yyyy", Locale.ENGLISH);Date to = transFormat.parse(dtString); SimpleDateFormat transFormat2 = new SimpleDateFormat("yyyy-MM-dd"); String to2 = transFormat2.format(to);