Class TypeMap


  • public class TypeMap
    extends Object
    Mapping an object's type to the object.
    • Constructor Detail

      • TypeMap

        public TypeMap()
    • Method Detail

      • put

        public <T> void put​(Class<T> type,
                            T instance)
        Puts a new type and instance into the TypeMap.
        Type Parameters:
        T - The type.
        Parameters:
        type - The type.
        instance - The instance.
      • get

        public <T> T get​(Class<T> type)
        Gets an instance from the TypeMap given the type.
        Type Parameters:
        T - The type.
        Parameters:
        type - The type.
        Returns:
        The instance.