Package org.opencms.util
Class CmsCollectionsGenericWrapper
java.lang.Object
org.opencms.util.CmsCollectionsGenericWrapper
Provides Map wrapping utility functions for Java generics.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWrapper for lazy maps providing a better containsKey implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> 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> Map <K, V> Provides a wrapper to create aLRUMapthat avoids warnings with Java 1.5 generic code.static <K,V> 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> Enumeration<K> enumeration(Enumeration<?> enumeration) Provides a wrapper to convert an enumeration that avoids warnings with Java 1.5 generic code.static <K> List<K> Provides a wrapper to convert an object into a list that avoids warnings with Java 1.5 generic code.static <K,V> Map <K, V> Provides a wrapper to convert an object into a map that avoids warnings with Java 1.5 generic code.
-
Method Details
-
createLazyMap
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
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
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
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
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
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
-