Package org.opencms.util
Class CmsCollectionsGenericWrapper
- java.lang.Object
-
- org.opencms.util.CmsCollectionsGenericWrapper
-
public final class CmsCollectionsGenericWrapper extends java.lang.Object
Provides Map wrapping utility functions for Java generics.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmsCollectionsGenericWrapper.MapWrapper<K,V>Wrapper for lazy maps providing a better containsKey implementation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
java.util.Map<K,V>createLazyMap(org.apache.commons.collections.Transformer T)Provides a wrapper to access theLazyMapfunctionality that avoids warnings with Java 1.5 generic code.static <K,V>
java.util.Map<K,V>createLRUMap()Provides a wrapper to create aLRUMapthat avoids warnings with Java 1.5 generic code.static <K,V>
java.util.Map<K,V>createLRUMap(int size)Provides a wrapper to create aLRUMapwith the given size that avoids warnings with Java 1.5 generic code.static <K> java.util.Enumeration<K>enumeration(java.util.Enumeration<?> enumeration)Provides a wrapper to convert an enumeration that avoids warnings with Java 1.5 generic code.static <K> java.util.List<K>list(java.lang.Object o)Provides a wrapper to convert an object into a list that avoids warnings with Java 1.5 generic code.static <K,V>
java.util.Map<K,V>map(java.lang.Object o)Provides a wrapper to convert an object into a map that avoids warnings with Java 1.5 generic code.
-
-
-
Method Detail
-
createLazyMap
public static <K,V> java.util.Map<K,V> createLazyMap(org.apache.commons.collections.Transformer T)
Provides a wrapper to access theLazyMapfunctionality that avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of keys maintained by the returned mapV- the type of mapped values- Parameters:
T- the transformer to use for the Lazy Map- Returns:
- a
LazyMapof the required generic type
-
createLRUMap
public static <K,V> java.util.Map<K,V> createLRUMap()
Provides a wrapper to create aLRUMapthat avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of keys maintained by the returned mapV- the type of mapped values- Returns:
- a
LRUMapof the required generic type
-
createLRUMap
public static <K,V> java.util.Map<K,V> createLRUMap(int size)
Provides a wrapper to create aLRUMapwith the given size that avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of keys maintained by the returned mapV- the type of mapped values- Parameters:
size- the initial size of the created Map- Returns:
- a
LRUMapwith the given size of the required generic type
-
enumeration
public static <K> java.util.Enumeration<K> enumeration(java.util.Enumeration<?> enumeration)
Provides a wrapper to convert an enumeration that avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of the returned enumeration elements- Parameters:
enumeration- the enumeration to be converted- Returns:
- a
Enumerationwith the required generic type
-
list
public static <K> java.util.List<K> list(java.lang.Object o)
Provides a wrapper to convert an object into a list that avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of the returned list elements- Parameters:
o- the object to be converted- Returns:
- a
Listwith the required generic type
-
map
public static <K,V> java.util.Map<K,V> map(java.lang.Object o)
Provides a wrapper to convert an object into a map that avoids warnings with Java 1.5 generic code.- Type Parameters:
K- the type of keys maintained by the returned mapV- the type of mapped values- Parameters:
o- the object to be converted- Returns:
- a
Mapof the required generic type
-
-