java stream对象转Map

public class SystemZfjdToJf {

    private String zfjdId;

    private Long jfId;
}
Map idMap = idBeans.stream().collect(Collectors.toMap(item -> item.getZfjdId(), item -> item.getJfId()));

你可能感兴趣的:(java,java,开发语言)