diff --git a/src/main/java/org/sopt/confeti/global/util/artistsearcher/ArtistResolver.java b/src/main/java/org/sopt/confeti/global/util/artistsearcher/ArtistResolver.java index 728bc43..f92149c 100644 --- a/src/main/java/org/sopt/confeti/global/util/artistsearcher/ArtistResolver.java +++ b/src/main/java/org/sopt/confeti/global/util/artistsearcher/ArtistResolver.java @@ -17,6 +17,7 @@ @RequiredArgsConstructor(access = AccessLevel.PROTECTED) public class ArtistResolver { + // 기존에 조회할 클래스를 매핑 private final ConcurrentHashMap, IntegrateFunction> collectByTypeMapper = new ConcurrentHashMap, IntegrateFunction>() {{ put(ArtistFavorite.class, args -> { collectArtistFavorite(args[0]); @@ -67,10 +68,12 @@ private void collect(final Object target) { return; } + // 주어진 타겟이 리스트일 경우 if (isListType(target)) { List objects = (List) target; objects.forEach(object -> { + // Mapper에 등록된 클래스 타입인 경우 if (collectByTypeMapper.containsKey(object.getClass())) { collectByTypeMapper.get(object.getClass()) .apply(object); @@ -80,6 +83,7 @@ private void collect(final Object target) { return; } + // Mapper에 등록된 클래스 타입인 경우 if (collectByTypeMapper.containsKey(target.getClass())) { collectByTypeMapper.get(target.getClass()).apply(target); }