com.nefariouszhen.dropwizard.assets.AssetsConfiguration Maven / Gradle / Ivy
package com.nefariouszhen.dropwizard.assets;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotNull;
import java.util.Map;
public class AssetsConfiguration {
/**
* Initialize cacheSpec to null so that whatever may be specified by code is able to be overridden by configuration.
* If null the default cache spec of "maximumSize=100" will be used.
* @see com.nefariouszhen.dropwizard.assets.ConfiguredAssetsBundle#DEFAULT_CACHE_SPEC
*/
@JsonProperty
private String cacheSpec = null;
@NotNull
@JsonProperty
private Map overrides = Maps.newHashMap();
@NotNull
@JsonProperty
private Map mimeTypes = Maps.newHashMap();
/**
* The caching specification for how to memoize assets.
* @return The cacheSpec.
*/
public String getCacheSpec() {
return cacheSpec;
}
public Iterable> getOverrides() {
return Iterables.unmodifiableIterable(overrides.entrySet());
}
public Iterable> getMimeTypes() {
return Iterables.unmodifiableIterable(mimeTypes.entrySet());
}
}