// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CacheControlConfiguration.java
// public class CacheControlConfiguration {
//     private List<CacheControlConfigurationItem> _items = ImmutableList.of();
// 
//     public CacheControlConfiguration() {
//         // Do nothing
//     }
// 
//     @JsonCreator
//     public CacheControlConfiguration(List<CacheControlConfigurationItem> items) {
//         checkNotNull(items);
//         _items = ImmutableList.copyOf(items);
//     }
// 
//     @JsonValue
//     public List<CacheControlConfigurationItem> getItems() {
//         return _items;
//     }
// 
//     public Function<String, Optional<String>> buildMapper() {
//         if (_items.size() == 0) {
//             return new Function<String, Optional<String>>() {
//                 public Optional<String> apply(@Nullable String input) {
//                     return Optional.absent();
//                 }
//             };
//         }
// 
//         final List<CacheControlMap> maps = FluentIterable
//                 .from(_items)
//                 .transform(new Function<CacheControlConfigurationItem, CacheControlMap>() {
//                     public CacheControlMap apply(CacheControlConfigurationItem input) {
//                         return new CacheControlMap(input);
//                     }
//                 })
//                 .toList();
// 
//         return CacheBuilder.newBuilder()
//                 .maximumSize(100)
//                 .build(
//                         new CacheLoader<String, Optional<String>>() {
//                             @Override
//                             public Optional<String> load(String key) throws Exception {
//                                 for (CacheControlMap map : maps) {
//                                     if (map.groupMatcher.apply(key)) {
//                                         return Optional.of(map.options);
//                                     }
//                                 }
// 
//                                 return Optional.absent();
//                             }
//                         }
//                 );
//     }
// 
//     private static class CacheControlMap {
//         public final Predicate<String> groupMatcher;
//         public final String options;
// 
//         public CacheControlMap(CacheControlConfigurationItem item) {
//             this.groupMatcher = item.buildGroupMatcher();
//             this.options = item.buildCacheControl().toString();
//         }
//     }
// }
// 
// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CachingBundleConfiguration.java
// public interface CachingBundleConfiguration {
//     CachingConfiguration getCache();
// 
//     CacheControlConfiguration getCacheControl();
// }
// 
// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CachingConfiguration.java
// public class CachingConfiguration {
//     private LocalCacheConfiguration _local = new LocalCacheConfiguration();
//     private ResponseStoreFactory _storeFactory = ResponseStoreFactory.NULL_STORE_FACTORY;
// 
//     public LocalCacheConfiguration getLocal() {
//         return _local;
//     }
// 
//     @JsonProperty
//     public void setLocal(LocalCacheConfiguration local) {
//         _local = checkNotNull(local);
//     }
// 
//     public ResponseStoreFactory getStoreFactory() {
//         return _storeFactory;
//     }
// 
//     @JsonProperty("store")
//     public void setStoreFactory(ResponseStoreFactory storeFactory) {
//         _storeFactory = checkNotNull(storeFactory);
//     }
// 
//     public ResponseCache buildCache(MetricRegistry metricRegistry) {
//         return new ResponseCache(_local.buildCache(), _storeFactory.createStore(), metricRegistry);
//     }
// }


import com.bazaarvoice.dropwizard.caching.CacheControlConfiguration;
import com.bazaarvoice.dropwizard.caching.CachingBundleConfiguration;
import com.bazaarvoice.dropwizard.caching.CachingConfiguration;
import io.dropwizard.Configuration;
/*
 * Copyright 2014 Bazaarvoice, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bazaarvoice.dropwizard.caching.example;


public class ExampleConfiguration extends Configuration implements CachingBundleConfiguration {
    private CachingConfiguration cache = new CachingConfiguration();
// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CacheControlConfiguration.java
// public class CacheControlConfiguration {
//     private List<CacheControlConfigurationItem> _items = ImmutableList.of();
// 
//     public CacheControlConfiguration() {
//         // Do nothing
//     }
// 
//     @JsonCreator
//     public CacheControlConfiguration(List<CacheControlConfigurationItem> items) {
//         checkNotNull(items);
//         _items = ImmutableList.copyOf(items);
//     }
// 
//     @JsonValue
//     public List<CacheControlConfigurationItem> getItems() {
//         return _items;
//     }
// 
//     public Function<String, Optional<String>> buildMapper() {
//         if (_items.size() == 0) {
//             return new Function<String, Optional<String>>() {
//                 public Optional<String> apply(@Nullable String input) {
//                     return Optional.absent();
//                 }
//             };
//         }
// 
//         final List<CacheControlMap> maps = FluentIterable
//                 .from(_items)
//                 .transform(new Function<CacheControlConfigurationItem, CacheControlMap>() {
//                     public CacheControlMap apply(CacheControlConfigurationItem input) {
//                         return new CacheControlMap(input);
//                     }
//                 })
//                 .toList();
// 
//         return CacheBuilder.newBuilder()
//                 .maximumSize(100)
//                 .build(
//                         new CacheLoader<String, Optional<String>>() {
//                             @Override
//                             public Optional<String> load(String key) throws Exception {
//                                 for (CacheControlMap map : maps) {
//                                     if (map.groupMatcher.apply(key)) {
//                                         return Optional.of(map.options);
//                                     }
//                                 }
// 
//                                 return Optional.absent();
//                             }
//                         }
//                 );
//     }
// 
//     private static class CacheControlMap {
//         public final Predicate<String> groupMatcher;
//         public final String options;
// 
//         public CacheControlMap(CacheControlConfigurationItem item) {
//             this.groupMatcher = item.buildGroupMatcher();
//             this.options = item.buildCacheControl().toString();
//         }
//     }
// }
// 
// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CachingBundleConfiguration.java
// public interface CachingBundleConfiguration {
//     CachingConfiguration getCache();
// 
//     CacheControlConfiguration getCacheControl();
// }
// 
// Path: bundle/src/main/java/com/bazaarvoice/dropwizard/caching/CachingConfiguration.java
// public class CachingConfiguration {
//     private LocalCacheConfiguration _local = new LocalCacheConfiguration();
//     private ResponseStoreFactory _storeFactory = ResponseStoreFactory.NULL_STORE_FACTORY;
// 
//     public LocalCacheConfiguration getLocal() {
//         return _local;
//     }
// 
//     @JsonProperty
//     public void setLocal(LocalCacheConfiguration local) {
//         _local = checkNotNull(local);
//     }
// 
//     public ResponseStoreFactory getStoreFactory() {
//         return _storeFactory;
//     }
// 
//     @JsonProperty("store")
//     public void setStoreFactory(ResponseStoreFactory storeFactory) {
//         _storeFactory = checkNotNull(storeFactory);
//     }
// 
//     public ResponseCache buildCache(MetricRegistry metricRegistry) {
//         return new ResponseCache(_local.buildCache(), _storeFactory.createStore(), metricRegistry);
//     }
// }


// Path: example/src/main/java/com/bazaarvoice/dropwizard/caching/example/ExampleConfiguration.java
import com.bazaarvoice.dropwizard.caching.CacheControlConfiguration;
import com.bazaarvoice.dropwizard.caching.CachingBundleConfiguration;
import com.bazaarvoice.dropwizard.caching.CachingConfiguration;
import io.dropwizard.Configuration;

/*
 * Copyright 2014 Bazaarvoice, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bazaarvoice.dropwizard.caching.example;


public class ExampleConfiguration extends Configuration implements CachingBundleConfiguration {
    private CachingConfiguration cache = new CachingConfiguration();
    public CacheControlConfiguration cacheControl = new CacheControlConfiguration();