sets cache for the query result on this instance
@param cache new instance's value of cache
15255
public synchronized void setCache(RemoteListCache cache) {
		if (cache != null && (this.cache == null || !this.cache.isComplete())) {
			this.cache = cache;
		}
	}
792965
def set_metadata_cache(cache):
    
    global _METADATA_CACHE

    if _METADATA_CACHE and _METADATA_CACHE.is_open:
        _METADATA_CACHE.close()

    _METADATA_CACHE = cache
715364
@Override
	public void cacheResult(List<CommerceOrder> commerceOrders) {
		for (CommerceOrder commerceOrder : commerceOrders) {
			if (entityCache.getResult(
						CommerceOrderModelImpl.ENTITY_CACHE_ENABLED,
						CommerceOrderImpl.class, commerceOrder.getPrimaryKey()) == null) {
				cacheResult(commerceOrder);
			}
			else {
				commerceOrder.resetOriginalValues();
			}
		}
	}
436069
private static synchronized Object getFromCache(Cache cache,
            byte[] encoding) {
        Object key = new Cache.EqualByteArray(encoding);
        Object value = cache.get(key);
        return value;
    }
86708
public function setCache($cache) : self
    {
        if (is_string($cache)) {
            $this->cache = CacheFactory::make($cache);
        } elseif ($cache instanceof Cacheable) {
            $this->cache = $cache;
        }

        $prefix = 'tus:' . strtolower((new \ReflectionClass(static::class))->getShortName()) . ':';

        $this->cache->setPrefix($prefix);

        return $this;
    }
812914
public function setCache($cache, $namespace = null)
    {
        if($cache && ClassRegistryCache::isSupported())
        {
            $this->__registry = new ClassRegistryCache();

            if($namespace) {
                $this->__registry->setNamespace($namespace);
            }
        }
        else
        {
            if(!$this->__registry instanceof ClassRegistry) {
                $this->__registry = new ClassRegistry();
            }
        }

        return $this;
    }
317383
public function setCacheStorage(WURFL_Storage_Base $cache)
    {
        if (!$this->supportsSecondaryCaching()) {
            throw new WURFL_Storage_Exception("The storage provider ".get_class($cache)." cannot be used as a cache for ".get_class($this));
        }
        $this->cache = $cache;
    }
1072087
@Override
    public <K, V> Cache<K, V> getCache(String cacheName) {
        return this.getCache(cacheName, true);
    }
108208
public void code(Cache<G> cache, G xgen) throws APIException, IOException {
		code(null, null,cache,xgen);
	}
897343
public void cache(Integer key, Object value) {
        synchronized (this) {
            Integer curkey = keys.get(value);
            // Already cached?
            if (curkey != null) return;
            cache.put(key, value);
            keys.put(value, key);
        }
    }
691485
@Override
	public void cacheResult(CPInstance cpInstance) {
		entityCache.putResult(CPInstanceModelImpl.ENTITY_CACHE_ENABLED,
			CPInstanceImpl.class, cpInstance.getPrimaryKey(), cpInstance);

		finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
			new Object[] { cpInstance.getUuid(), cpInstance.getGroupId() },
			cpInstance);

		finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
			new Object[] {
				cpInstance.getCPDefinitionId(), cpInstance.getCPInstanceUuid()
			}, cpInstance);

		finderCache.putResult(FINDER_PATH_FETCH_BY_C_S,
			new Object[] { cpInstance.getCPDefinitionId(), cpInstance.getSku() },
			cpInstance);

		finderCache.putResult(FINDER_PATH_FETCH_BY_C_ERC,
			new Object[] {
				cpInstance.getCompanyId(), cpInstance.getExternalReferenceCode()
			}, cpInstance);

		cpInstance.resetOriginalValues();
	}
588810
@Override
    public Cache getCache(String cacheName) throws CacheException
    {
        if (this.cache == null)
        {
            this.cache = createCache(cacheName);
        }

        return this.cache;
    }
570242
@Override
	public void cacheResult(CommerceWarehouse commerceWarehouse) {
		entityCache.putResult(CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
			CommerceWarehouseImpl.class, commerceWarehouse.getPrimaryKey(),
			commerceWarehouse);

		commerceWarehouse.resetOriginalValues();
	}
831155
public void setCacheLocation(String cacheLocation) {
		if(cacheLocation.equals(this.cacheLocation)) {
			return; //no change
		}
		// update location
		domainsFileLock.writeLock().lock();
		logger.trace("LOCK writelock");
		this.cacheLocation = cacheLocation;
		logger.trace("UNLOCK writelock");
		domainsFileLock.writeLock().unlock();
	}
1090426
def cache_set(self, to_cache):
        
        self.cache.set(self.cache_key, to_cache, self.expire_time)
703355
private void updateCache(int index, QueryParameters params) {
        if (generatedCacheMap.containsKey(index) == true) {
            this.generatedCacheMap.put(index, params);
        } else {
            this.resultSetCacheMap.put(index, params);
        }
    }
982599
public function set_hyphenator_cache( Hyphenator\Cache $cache ) {
		$this->hyphenator_cache = $cache;

		// Change hyphenator cache for existing token fixes.
		if ( isset( $this->registry ) ) {
			$this->registry->update_hyphenator_cache( $cache );
		}
	}