<commit_before>package com.github.bingoohuang.westcache;

import com.github.bingoohuang.westcache.cachemanager.WestCacheManagerBuilder;
import com.google.common.base.Optional;

import java.util.concurrent.Callable;

/**
 * @author bingoohuang [<EMAIL>] Created on 2016/12/22.
 */
public class WestCache {
    static WestCacheManager manager = WestCacheManagerBuilder.buildGuavaCacheManager();

    public static <T> Optional<T> get(
            String cacheKey, Callable<Optional<T>> callable) {
        return manager.get(cacheKey, callable);
    }

    public static <T> Optional<T> get(String cacheKey) {
        return manager.get(cacheKey);
    }

    public static <T> Optional<T> getSnapshot(
            String cacheKey, Callable<Optional<T>> callable) {
        return manager.getSnapshot(cacheKey, callable);
    }

    public static <T> void put(String cacheKey, Optional<T> cacheValue) {
        manager.put(cacheKey, cacheValue);
    }<commit_msg>lombok UtilityClass<commit_after>package com.github.bingoohuang.westcache;

import com.github.bingoohuang.westcache.cachemanager.WestCacheManagerBuilder;
import com.google.common.base.Optional;
import lombok.experimental.UtilityClass;

import java.util.concurrent.Callable;

/**
 * @author bingoohuang [<EMAIL>] Created on 2016/12/22.
 */
@UtilityClass
public class WestCache {
    WestCacheManager manager = WestCacheManagerBuilder.buildGuavaCacheManager();

    public <T> Optional<T> get(String cacheKey, Callable<Optional<T>> callable) {
        return manager.get(cacheKey, callable);
    }

    public <T> Optional<T> get(String cacheKey) {
        return manager.get(cacheKey);
    }

    public <T> Optional<T> getSnapshot(String cacheKey, Callable<Optional<T>> callable) {
        return manager.getSnapshot(cacheKey, callable);
    }

    public <T> void put(String cacheKey, Optional<T> cacheValue) {
        manager.put(cacheKey, cacheValue);
    }
{'fraction_non_alphanumeric': 0.11041666666666666, 'fraction_numerical': 0.008333333333333333, 'mean_word_length': 4.082010582010582, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3749091', 'n_tokens_mistral': 603, 'n_tokens_neox': 577, 'n_words': 123}