001/*002 * Copyright 2012-2018 the original author or authors.003 *004 * Licensed under the Apache License, Version 2.0 (the "License");005 * you may not use this file except in compliance with the License.006 * You may obtain a copy of the License at007 *008 * http://www.apache.org/licenses/LICENSE-2.0009 *010 * Unless required by applicable law or agreed to in writing, software011 * distributed under the License is distributed on an "AS IS" BASIS,012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.013 * See the License for the specific language governing permissions and014 * limitations under the License.015 */016017package org.springframework.boot.autoconfigure.cache;018019import java.time.Duration;020import java.util.ArrayList;021import java.util.List;022023import org.springframework.boot.context.properties.ConfigurationProperties;024import org.springframework.core.io.Resource;025import org.springframework.util.Assert;026027/**028 * Configuration properties for the cache abstraction.029 *030 * @author Stephane Nicoll031 * @author EddĂș MelĂ©ndez032 * @author Ryon Day033 * @since 1.3.0034 */035@ConfigurationProperties(prefix = "spring.cache")036public class CacheProperties {037038 /**039 * Cache type. By default, auto-detected according to the environment.040 */041 private CacheType type;042043 /**044 * Comma-separated list of cache names to create if supported by the underlying cache045 * manager. Usually, this disables the ability to create additional caches on-the-fly.046 */047 private List<String> cacheNames = new ArrayList<>();048049 private final Caffeine caffeine = new Caffeine();050051 private final Couchbase couchbase = new Couchbase();052053 private final EhCache ehcache = new EhCache();054055 private final Infinispan infinispan = new Infinispan();056057 private final JCache jcache = new JCache();058059 private final Redis redis = new Redis();060061 public CacheType getType() {062 return this.type;063 }064065 public void setType(CacheType mode) {066 this.type = mode;067 }068069 public List<String> getCacheNames() {070 return this.cacheNames;071 }072073 public void setCacheNames(List<String> cacheNames) {074 this.cacheNames = cacheNames;075 }076077 public Caffeine getCaffeine() {078 return this.caffeine;079 }080081 public Couchbase getCouchbase() {082 return this.couc