本文整理汇总了Java中com.google.common.cache.CacheBuilder.from方法的典型用法代码示例。如果您正苦于以下问题:Java CacheBuilder.from方法的具体用法?Java CacheBuilder.from怎么用?Java CacheBuilder.from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.cache.CacheBuilder
的用法示例。
在下文中一共展示了CacheBuilder.from方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCacheBuilderSpec
import com.google.common.cache.CacheBuilder; //导入方法依赖的package包/类
/**
* Set the Guava CacheBuilderSpec to use for building each individual
* {@link GuavaCache} instance.
* @see #createNativeGuavaCache
* @see com.google.common.cache.CacheBuilder#from(CacheBuilderSpec)
*/
public void setCacheBuilderSpec(CacheBuilderSpec cacheBuilderSpec) {
this.cacheBuilder = CacheBuilder.from(cacheBuilderSpec);
}
示例2: setCacheSpecification
import com.google.common.cache.CacheBuilder; //导入方法依赖的package包/类
/**
* Set the Guava cache specification String to use for building each
* individual {@link GuavaCache} instance. The given value needs to
* comply with Guava's {@link CacheBuilderSpec} (see its javadoc).
* @see #createNativeGuavaCache
* @see com.google.common.cache.CacheBuilder#from(String)
*/
public void setCacheSpecification(String cacheSpecification) {
this.cacheBuilder = CacheBuilder.from(cacheSpecification);
}