Skip to content

Commit

Permalink
chore[storage]: rename generic type
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 19, 2024
1 parent 0689809 commit 552ebac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static Object convertToArray(String content, Class<?> componentType) {
return array;
}

public static <T> List<T> convertToList(String content, Class<T> type) {
public static <T> List<T> convertToList(String content, Class<T> genericType) {
content = StringUtils.trim(content);
if (StringUtils.isEmpty(content)) {
return Collections.emptyList();
Expand All @@ -76,17 +76,17 @@ public static <T> List<T> convertToList(String content, Class<T> type) {
var length = splits.length;
var list = new ArrayList<T>();
for (var i = 0; i < length; i++) {
var value = ConvertUtils.convert(StringUtils.trim(splits[i]), type);
var value = ConvertUtils.convert(StringUtils.trim(splits[i]), genericType);
list.add(value);
}
return Collections.unmodifiableList(list);
}

public static <T> Set<T> convertToSet(String content, Class<T> type) {
public static <T> Set<T> convertToSet(String content, Class<T> genericType) {
content = StringUtils.trim(content);
if (StringUtils.isEmpty(content)) {
return Collections.emptySet();
}
return Set.copyOf(convertToList(content, type));
return Set.copyOf(convertToList(content, genericType));
}
}

0 comments on commit 552ebac

Please sign in to comment.