As the error tells you, the type of a Scala's Enumeration
members' is actually Value
. So:
import scala.Enumeration.Value;
//...
public Value getWeekDay() {
return WeekDay.withName(this.myWeekDay);
}
Unfortunately, Scala type aliases are not visible from Java code, so you can't use your WeekDay.WeekDay
here.