'list'에 해당되는 글 3건

  1. 2021.09.14 [Java] List 중복 제거.
  2. 2016.11.09 [Java] String[] to List, List dedup. List to String comma
  3. 2016.09.30 [Git] 리모트 브랜치 목록 새로고침.

[Java] List 중복 제거.

ITWeb/개발일반 2021. 9. 14. 12:34

DictionaryModel 은 String, List<String> 맴버 변수를 가집니다.

이 맴버 변수 중 List<String> 을 모두 펼쳐서 distinct word 목록을 만들려고 합니다.

 

List<String> flats = new ArrayList<>();
List<String> words = new ArrayList<>();

for (DictionaryModel d : dictionarys ) {
	words.addAll(d.getAnalyzed());
}

flats = words.stream().distinct().collect(Collectors.toList());

기억력을 돕기 위해 기록해 봅니다.

 

:

[Java] String[] to List, List dedup. List to String comma

ITWeb/개발일반 2016. 11. 9. 12:42

이젠 뭘 해도 기억력이 따라오질 못합니다. ㅠ.ㅠ

복습을 위해서.


Stirng[] to List)

String[] keywords = {"기어", "s3", "기어"};

List<String> lists = Arrays.asList(keywords);


List DeDup)

HashSet<String> set = new HashSet<>(lists);

List<String> result = new ArrayList<>(set);


List to String comma)

StringUtils.join(result, ',');


:

[Git] 리모트 브랜치 목록 새로고침.

ITWeb/개발일반 2016. 9. 30. 18:06

ide를 사용하다 보면 git remote branch 목록 sync 가 안될 때가 있습니다.

그래서 수동으로 명령어 날려 주는데요.

혹시 몰라 그냥 기록해 봅니다.



$ git remote prune origin --dry-run


dry run 해보시고 최종 실행 시에는 빼고 돌리시면 됩니다.

: