Little improvement of TabProposal
This commit is contained in:
parent
4dd7f86416
commit
241671c0aa
@ -24,6 +24,15 @@ public interface TabProposal {
|
|||||||
public static TabProposal empty() { return Collections::emptyList; }
|
public static TabProposal empty() { return Collections::emptyList; }
|
||||||
|
|
||||||
|
|
||||||
|
public static <E extends Enum<E>> TabProposal fromEnum(Class<E> enumClass) {
|
||||||
|
return fromEnumValues(enumClass.getEnumConstants());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SafeVarargs
|
||||||
|
public static <E extends Enum<E>> TabProposal fromEnumValues(E... enumValues) {
|
||||||
|
return () -> Arrays.stream(enumValues).map(Enum::name).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
public static TabProposal fromCollection(Collection<String> proposals) {
|
public static TabProposal fromCollection(Collection<String> proposals) {
|
||||||
return () -> proposals;
|
return () -> proposals;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user