what-the-bank/sources/com/huawei/hms/common/data/FreezableUtils.java

30 lines
929 B
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.common.data;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import org.simpleframework.xml.core.FieldScanner;
/* loaded from: classes2.dex */
public final class FreezableUtils {
public static <T, E extends Freezable<T>> ArrayList<T> freeze(ArrayList<E> arrayList) {
return freezeIterable(arrayList);
}
public static <T, E extends Freezable<T>> ArrayList<T> freezeIterable(Iterable<E> iterable) {
FieldScanner fieldScanner = (ArrayList<T>) new ArrayList();
if (iterable == null) {
return fieldScanner;
}
Iterator<E> it = iterable.iterator();
while (it.hasNext()) {
fieldScanner.add(it.next().freeze());
}
return fieldScanner;
}
public static <T, E extends Freezable<T>> ArrayList<T> freeze(E[] eArr) {
return freezeIterable(Arrays.asList(eArr));
}
}