Class ContextMap<K,​V>

    • Field Detail

      • logger

        protected Logger logger
    • Constructor Detail

      • ContextMap

        public ContextMap()
        Creates a new, empty Context with a default initial capacity, load factor, and concurrencyLevel.
      • ContextMap

        public ContextMap​(Logger logger)
        Creates a new, empty Context with a default initial capacity, load factor, and concurrencyLevel.
      • ContextMap

        public ContextMap​(int initialCapacity)
        Creates a new, empty Context with the specified initial capacity, and with default load factor and concurrencyLevel
        Parameters:
        initialCapacity - the initial capacity.
      • ContextMap

        public ContextMap​(int initialCapacity,
                          float loadFactor,
                          int concurrencyLevel)
        Creates a new, empty Context with the specified initial capacity, load factor, and concurrency level.
        Parameters:
        initialCapacity - the initial capacity.
        loadFactor - the load factor threshold, used to control resizing.
        concurrencyLevel - the estimated number of concurrently updating threads.
      • ContextMap

        public ContextMap​(Map<? extends K,​? extends V> t)
        Creates a new Context with the same mappings as the given map.
        Parameters:
        t - Map whose key-value pairs are added
    • Method Detail

      • retrieve

        public <T extends V> T retrieve​(K key)
        That method enhances the Map.get(Object) method that helps users avoid the redundant code of type cast/checking when assignments are already known.

        It throws ClassCastException if types are not assignable.

        Specified by:
        retrieve in interface Context<K,​V>
        Type Parameters:
        T - the target assignment type
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        the value to which the specified key is mapped, or null if this map contains no mapping for the key
        See Also:
        Map.get(Object)
      • logger

        public Logger logger()
        Description copied from interface: Context
        This method provider a Logger utililies for user can't construct a logger or try to log pipeline context message to one logger file.
        Specified by:
        logger in interface Context<K,​V>
        Returns:
        logger