ImmutableMap
创建map的同时赋值
Map<Boolean, Consumer<ProcessContext<NotificationModel>>> actionMap = new ImmutableMap.Builder<Boolean, Consumer<ProcessContext<NotificationModel>>>()
.put(Boolean.FALSE, resourceIdAction)
.put(Boolean.TRUE, emptyResourceIdAction)
.build();
原创:做时间的朋友