I have an entity that has an enum property:
// MyFile.java
public class MyFile {
private DownloadStatus downloadStatus;
// other properties, sette
Every Java enum has an ordinal which is automatically assigned, so you don't need to manually specify the int (but be aware that ordinals start from 0, not 1).
Then, to get your enum from the ordinal, you can do:
int downloadStatus = ...
DownloadStatus ds = DownloadStatus.values()[downloadStatus];
... then you can do your switch using the enum ...
switch (ds)
{
case NOT_DOWNLOADED:
...
}