我正在尝试检查我的 VO 中设置了哪些值。
下面是我的课。我得到“合格的案例标签 MyEnum.UserType.DOCTORS 必须替换为不合格的枚举常量 DOCTORS ”
请帮助我确定我在这里做错了什么。
我的枚举.java
public MyEnum{
private UserType userType;
public UserType getUserType(){
return userType;
}
public void setUserType(UserType userType){
this.userType = userType;
}
public static enum UserType{
DOCTORS("D"),
PATIENT("P"),
STAFF("S");
}
}
枚举测试.java
public EnumTest {
.....
public void onGoBack(MyEnum myEnum) {
switch(myEnum.getUserType())
{
case UserType.DOCTORS: // this shows "The qualified case label MyEnum.UserType.DOCTORS must be replaced with the unqualified enum constant DOCTORS"
break;
}
}
}