Created
July 26, 2018 11:47
-
-
Save codethereforam/07df10a14d1207029561b5d06ca86a17 to your computer and use it in GitHub Desktop.
集合转换为其成员变量的集合(before java8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> nameList = Lists.transform(departmentDtoList, new Function<DepartmentDto, String>() { | |
@Nullable | |
@Override | |
public String apply(@Nullable DepartmentDto input) { | |
return input != null ? input.getDepartmentName() : null; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment