Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Unit> yards = new ArrayList<>(unitsApi.getAllUnits());
- Collections.sort(yards, new BeanComparator<Unit>("name"));
- //another try
- List<Unit> sortedNames = yards.stream().sorted().collect(Collectors.toList());
- //num3 another
- //List<Unit> sortedList = yards
- .stream().sorted(Comparator.comparing(Object::toString))
- .collect(Collectors.toList());
- model.addAttribute("yards", sortedList);
Add Comment
Please, Sign In to add comment