Class CmsCollectionsGenericWrapper

java.lang.Object
org.opencms.util.CmsCollectionsGenericWrapper

public final class CmsCollectionsGenericWrapper extends Object
Provides Map wrapping utility functions for Java generics.

Since:
8.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Wrapper for lazy maps providing a better containsKey implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <K, V> Map<K,V>
    createLazyMap(org.apache.commons.collections.Transformer T)
    Provides a wrapper to access the LazyMap functionality that avoids warnings with Java 1.5 generic code.
    static <K, V> Map<K,V>
    Provides a wrapper to create a LRUMap that avoids warnings with Java 1.5 generic code.
    static <K, V> Map<K,V>
    createLRUMap(int size)
    Provides a wrapper to create a LRUMap 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createLazyMap

      public static <K, V> Map<K,V> createLazyMap(org.apache.commons.collections.Transformer T)
      Provides a wrapper to access the LazyMap functionality that avoids warnings with Java 1.5 generic code.

      Type Parameters:
      K - the type of keys maintained by the returned map
      V - the type of mapped values
      Parameters:
      T - the transformer to use for the Lazy Map
      Returns:
      a LazyMap of the required generic type
    • createLRUMap

      public static <K, V> Map<K,V> createLRUMap()
      Provides a wrapper to create a LRUMap that avoids warnings with Java 1.5 generic code.

      Type Parameters:
      K - the type of keys maintained by the returned map
      V - the type of mapped values
      Returns:
      a LRUMap of the required generic type
    • createLRUMap

      public static <K, V> Map<K,V> createLRUMap(int size)
      Provides a wrapper to create a LRUMap with the given size that avoids warnings with Java 1.5 generic code.

      Type Parameters:
      K - the type of keys maintained by the returned map
      V - 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

      public static <K> Enumeration<K> enumeration(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 Enumeration with the required generic type
    • list

      public static <K> List<K> list(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 List with the required generic type
    • map

      public static <K, V> Map<K,V> map(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 map
      V - the type of mapped values
      Parameters:
      o - the object to be converted
      Returns:
      a Map of the required generic type