protected final Map < K , V > copyMap ( Map < K , Expirable < V > > map ) { ClassLoader classLoader = cacheManager . getClassLoader ( ) ; return map . entrySet ( ) . stream ( ) . collect ( toMap ( entry -> copier . copy ( entry . getKey ( ) , classLoader ) , entry -> copier . copy ( entry . getValue ( ) . get ( ) , classLoader ) ) ) ; }
Returns a deep copy of the map if value - based caching is enabled .