forked from plusone/plusone-commons
删除意义不大的集合工具。
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package xyz.zhouxy.plusone.commons.collection;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ListTools {
|
||||
|
||||
public static <T> void transformValue(List<T> list, int index, Function<T, ? extends T> func) {
|
||||
list.set(index, func.apply(list.get(index)));
|
||||
}
|
||||
|
||||
private ListTools() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package xyz.zhouxy.plusone.commons.collection;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class MapTools {
|
||||
|
||||
public static <K, V> void transformValue(Map<K, V> map, K key, Function<V, ? extends V> func) {
|
||||
if (map.containsKey(key)) {
|
||||
map.put(key, func.apply(map.get(key)));
|
||||
}
|
||||
}
|
||||
|
||||
private MapTools() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package xyz.zhouxy.plusone.commons.collection;
|
||||
|
||||
import com.google.common.collect.Table;
|
||||
|
||||
public class TableTools {
|
||||
|
||||
public static <R, C, V> Table<R, C, V> synchronizedTable(Table<R, C, V> t) {
|
||||
if (t instanceof SynchronizedTable) {
|
||||
return t;
|
||||
}
|
||||
return SynchronizedTable.of(t);
|
||||
}
|
||||
|
||||
private TableTools() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user