Example usage for com.google.common.cache CacheBuilderSpec toParsableString

List of usage examples for com.google.common.cache CacheBuilderSpec toParsableString

Introduction

In this page you can find the example usage for com.google.common.cache CacheBuilderSpec toParsableString.

Prototype

public String toParsableString() 

Source Link

Document

Returns a string that can be used to parse an equivalent CacheBuilderSpec .

Usage

From source file:org.arbeitspferde.friesian.ConfigurableMapMakerCache.java

public ConfigurableMapMakerCache(final CacheBuilderSpec specification) throws IllegalArgumentException {
    Preconditions.checkNotNull(specification, "specification may not be null.");
    Preconditions.checkArgument(!specification.toParsableString().isEmpty(), "specification may not be empty.");

    backingMap = CacheBuilder.from(specification).<Integer, T>build().asMap();

    log.info(String.format("Created map with %s specification.", specification));
}