ImmutableMap

创建map的同时赋值

    Map<Boolean, Consumer<ProcessContext<NotificationModel>>> actionMap = new ImmutableMap.Builder<Boolean, Consumer<ProcessContext<NotificationModel>>>()
            .put(Boolean.FALSE, resourceIdAction)
            .put(Boolean.TRUE, emptyResourceIdAction)
            .build();
posted @ 2023-01-11 14:18  SpecialSpeculator  阅读(39)  评论(0编辑  收藏  举报