流式处理

30 阅读1分钟
List<Long> parentIdList = Arrays.stream(Optional.ofNullable(sysDept.getAncestors())
        .orElse("")
        .split(","))
        .filter(org.apache.commons.lang3.StringUtils::isNotEmpty)
        .map(Long::valueOf)
        .collect(Collectors.toList());