Kotlin/collection functional api - map, filter, flatten type api#19
Merged
Kotlin/collection functional api - map, filter, flatten type api#19
Conversation
map, flatMap, associate methods
associateTo, associateWithTo, associateByTo
remove flattening test in MappingTest.kt
…in List and Map structures
…larations for type clarity
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
app/src/test/java/com/example/learningtest/collection/functional/MappingTest.kt:35
- [nitpick] Consider using a more declarative conditional expression (for example, a when or an if-else expression) in the lambda instead of an early return to improve readability in this test.
if (index == 0) return@mapIndexedNotNull null
app/src/test/java/com/example/learningtest/collection/functional/FlatteningTest.kt:183
- The test uses an empty map, which makes both the toList() and flatMap() results empty. Consider adding a non-empty map test case to validate that the flattening behavior preserves the key-value relationship as expected.
Map<String, String>.toList().flatten 은 단순 Key-Value Pair 리스트로 변환
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 함수형 API의 장점
작업한 내용 요약
List,Map등mapTo,flatMapTo,associateTo,filterKeys,filterValues등)을 다양한 케이스로 검증파일별 작업 요약
MappingTest.kt:map,mapIndexed,mapNotNull과mapTo,flatMapTo,associateTo등 가변 리스트 대상의 매핑 테스트FilteringTest.kt:Map에 대한filter,filterKeys,filterValues테스트 추가FlatteningTest.kt: 중첩 리스트 및 맵에 대한flatten,flatMap테스트ListFunctionalApiTest.kt제거 (MappingTest등으로 분리 통합)