package com.aionemu.gameserver.utils.collections;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.slf4j.LoggerFactory;
public class CollectionUtil {
private CollectionUtil() {
}
public static <T> void forEach(Iterable<T> iterable, Consumer<T> consumer) {
forEach(iterable, consumer, null);
}
public static <T> void forEach(Iterable<T> iterable, Consumer<T> consumer, BiConsumer<T, Exception> onExceptionAction) {
iterable.forEach(object -> {
try {
consumer.accept(object);
} catch (Exception e) {
if (onExceptionAction != null) {
try {
onExceptionAction.accept(object, e);
return;
} catch (Exception e2) {
e.addSuppressed(e2);
}
}
LoggerFactory.getLogger(CollectionUtil.class).error("Could not perform operation on " + object, e);
}
});
}
}
순위 | 닉네임 | 포인트 |
---|---|---|
1 |
![]() |
102,949 |
2 |
![]() |
63,733 |
3 |
![]() |
51,771 |
4 |
![]() |
36,923 |
5 |
![]() |
35,011 |
6 |
![]() |
29,470 |
7 |
![]() |
29,077 |
8 |
![]() |
28,199 |
9 |
![]() |
26,731 |
10 |
![]() |
17,020 |