Records

2021-06-30 ( JAVA )

지후0816 2021. 7. 1. 13:36
오늘 진행한 일정

- JAVA Collections 내장 함수로 객체를 담은 배열 ( 2차원 배열 )의 필드값을 기준으로 오름차순, 내림차순 정렬하는 방법 습득.

 

- boolean은 데이터가 단순할 때만 사용하는 게 좋고, Map을 사용해서 여러 타입의 데이터를 취합하는 방법 습득.

 

 

 

JAVA

- 좋아요와 싫어요가 동시에 존재할 때, Controller에서 Repository까지 데이터를 전달하기 가장 좋은 자료구조는 Map이다.
- Stream sorted

public List<Article> getSortedArticles(List<Article> filteredArticles, String orderByColumn,
			  String orderAscTypeCode) {
  return filteredArticles.stream().sorted(Comparator.comparing(Article::getHitCount))
					.collect(Collectors.toList());
  }


 

 

내일 할 일

- 장기적으로 유리한 학습 방법을 고민해보는 시간 갖기.