mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-09 08:52:51 +00:00
Change-Id: If18611eb0a6296da808aead8f1da54be094db2a9
This commit is contained in:
@@ -4,7 +4,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* Factory class to create {@link Collection} instances.
|
||||
@@ -37,4 +39,21 @@ public class CollectionFactory {
|
||||
public static final <T> Set<T> newSet(Class<T> type) {
|
||||
return new HashSet<T>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new weak map.
|
||||
*
|
||||
* @param <K>
|
||||
* the key type
|
||||
* @param <V>
|
||||
* the value type
|
||||
* @param key
|
||||
* the key type class
|
||||
* @param value
|
||||
* the value type class
|
||||
* @return the new map
|
||||
*/
|
||||
public static final <K, V> Map<K, V> newWeakMap(Class<K> key, Class<V> value) {
|
||||
return new WeakHashMap<K, V>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user