private void cacheData ( @ NonNull final KeyType key , @ NonNull final DataType data ) { synchronized ( cache ) { if ( useCache ) { cache . put ( key , data ) ; } } }
Adds the data which corresponds to a specific key to the cache if caching is enabled .