Switch on Enum in Java: unqualified enum constant

Viewed 5508

I have this enum :

public class RemoteUnitType implements Serializable {

    public enum deviceVersion {
        ANDROID_AT1, 
        ANDROID_AT1_PRO, 
        ANDROID_AT5,
        ANDROID_AK1
    }

and I want to create a switch on Enum, like this

switch (remoteUnit.getDeviceVersion()) {
            case RemoteUnitType.deviceVersion.ANDROID_AK1 :
            break;  
}

But I got this error:

The qualified case label RemoteUnitType.deviceVersion.ANDROID_AK1 must be replaced with the unqualified enum constant 
2 Answers
Related