package com.shanghaichengdi.ghjgitem.cache;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import lombok.Builder;
import lombok.Data;

/**
 * @author gengaoliu
 */
public class CacheManager {

  public static Map<String, CacheFunParam> CACHE_FUNS = new HashMap<>();

  public static void putFun(String key, Object t, Function dataFun) {
    CacheFunParam funParam = CacheFunParam.builder().key(key).t(t).dataFun(dataFun).build();
    CACHE_FUNS.put(key, funParam);
  }

  @Data
  @Builder
  public static class CacheFunParam {

    String key;
    Object t;
    Function dataFun;
  }
}
