Java8 Stream에서 Type Cast하기
mycollection.stream()
.filter(elem -> elem instanceof MyClass)
.map(MyClass.class::cast)
.collect(Collectors.toList());
Purewell's Personal Blog
Java8 Stream에서 Type Cast하기
mycollection.stream()
.filter(elem -> elem instanceof MyClass)
.map(MyClass.class::cast)
.collect(Collectors.toList());
댓글
댓글 쓰기