Skip to content

Commit

Permalink
style [#81] 주석 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1hyun committed Jan 17, 2025
1 parent 8687069 commit df2d9f1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public class ArtistResolver {

// 기존에 조회할 클래스를 매핑
private final ConcurrentHashMap<Class<?>, IntegrateFunction> collectByTypeMapper = new ConcurrentHashMap<Class<?>, IntegrateFunction>() {{
put(ArtistFavorite.class, args -> {
collectArtistFavorite(args[0]);
Expand Down Expand Up @@ -67,10 +68,12 @@ private void collect(final Object target) {
return;
}

// 주어진 타겟이 리스트일 경우
if (isListType(target)) {
List<Object> objects = (List<Object>) target;

objects.forEach(object -> {
// Mapper에 등록된 클래스 타입인 경우
if (collectByTypeMapper.containsKey(object.getClass())) {
collectByTypeMapper.get(object.getClass())
.apply(object);
Expand All @@ -80,6 +83,7 @@ private void collect(final Object target) {
return;
}

// Mapper에 등록된 클래스 타입인 경우
if (collectByTypeMapper.containsKey(target.getClass())) {
collectByTypeMapper.get(target.getClass()).apply(target);
}
Expand Down

0 comments on commit df2d9f1

Please sign in to comment.