public enum CalendarEventType implements EnumClass<Integer> {
open(10),
createdByMe(20),
...;
private Integer id;
CalendarEventType(Integer value) {
this.id = value;
}
public Integer getId() {
return id;
}
public Integer getStyleId() {
return id/10;
}
@Nullable
public static CalendarEventType fromId(Integer id) {
for (CalendarEventType at : CalendarEventType.values()) {
if (at.getId().equals(id)) {
return at;
}
}
return null;
}
public String getQuery(){
...
return "";
}
}
for(CalendarEventType cet:List.of(CalendarEventType.createdByMe,CalendarEventType.open)
causes
NoSuchMethodError: java.util.List.of(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/List;
and whole CUBA crashes while
Arrays.asList(CalendarEventType.createdByMe,CalendarEventType.open)
doesn’t cause it