Reputation: 1754
I have this Java enum structure:
public enum MOStatus {
DRAFT,
ACTIVE,
ARCHIVED
}
I would like to map the values with a list:
private static Predicate moStatusStatusIn(MOStatus... statuses) {
List<String> status = Arrays.stream(statuses).map(MOStatus::values).collect(Collectors.toList());
}
But I get error Static method referenced through receiver
for MOStatus::values
What is the proper way to map the values?
Upvotes: 0
Views: 106
Reputation: 9596
Arrays.stream(statuses).map(Enum::name).collect(Collectors.toList())
Upvotes: 2