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
Modifier and TypeClassDescriptionstatic class
Wrapper 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 theLazyMap
functionality that avoids warnings with Java 1.5 generic code.static <K,
V> Map<K, V> Provides a wrapper to create aLRUMap
that avoids warnings with Java 1.5 generic code.static <K,
V> Map<K, V> createLRUMap
(int size) Provides a wrapper to create aLRUMap
with 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 theLazyMap
functionality 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
LazyMap
of the required generic type
-
createLRUMap
Provides a wrapper to create aLRUMap
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- Returns:
- a
LRUMap
of the required generic type
-
createLRUMap
Provides a wrapper to create aLRUMap
with 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
LRUMap
with 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
Enumeration
with 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
List
with 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
Map
of the required generic type
-