public class Controller { final List<Service> services; private final Map<Enum, Service> enumMap = new EnumMap<>(TaxSiteEnum.class); @PostConstruct public void init() { services.forEach(item -> enumMap.put(item.getEnum(), item)); } }
方式二
方式三
方式四
标签:策略,spring,public,模式,class,item,services,final From: https://www.cnblogs.com/javalbb/p/17100556.html